diff options
Diffstat (limited to 'libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML')
73 files changed, 11707 insertions, 0 deletions
diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio.h new file mode 100755 index 0000000..c7dd81b --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio.h @@ -0,0 +1,41 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_AUDIO_H +#define SFML_AUDIO_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// + +#include <SFML/System.h> +#include <SFML/Audio/Listener.h> +#include <SFML/Audio/Music.h> +#include <SFML/Audio/Sound.h> +#include <SFML/Audio/SoundBuffer.h> +#include <SFML/Audio/SoundBufferRecorder.h> +#include <SFML/Audio/SoundRecorder.h> + + +#endif // SFML_AUDIO_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Export.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Export.h new file mode 100755 index 0000000..5548003 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Export.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_AUDIO_EXPORT_H +#define SFML_AUDIO_EXPORT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Config.h> + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(CSFML_AUDIO_EXPORTS) + + #define CSFML_AUDIO_API CSFML_API_EXPORT + +#else + + #define CSFML_AUDIO_API CSFML_API_IMPORT + +#endif + + +#endif // SFML_AUDIO_EXPORT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Listener.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Listener.h new file mode 100755 index 0000000..e47d529 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Listener.h @@ -0,0 +1,95 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_LISTENER_H +#define SFML_LISTENER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/System/Vector3.h> + + +//////////////////////////////////////////////////////////// +/// \brief Change the global volume of all the sounds and musics +/// +/// The volume is a number between 0 and 100; it is combined with +/// the individual volume of each sound / music. +/// The default value for the volume is 100 (maximum). +/// +/// \param volume New global volume, in the range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfListener_setGlobalVolume(float volume); + +//////////////////////////////////////////////////////////// +/// \brief Get the current value of the global volume +/// +/// \return Current global volume, in the range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfListener_getGlobalVolume(void); + +//////////////////////////////////////////////////////////// +/// \brief Set the position of the listener in the scene +/// +/// The default listener's position is (0, 0, 0). +/// +/// \param position New position of the listener +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfListener_setPosition(sfVector3f position); + +//////////////////////////////////////////////////////////// +/// \brief Get the current position of the listener in the scene +/// +/// \return The listener's position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfVector3f sfListener_getPosition(); + +//////////////////////////////////////////////////////////// +/// \brief Set the orientation of the listener in the scene +/// +/// The orientation defines the 3D axes of the listener +/// (left, up, front) in the scene. The orientation vector +/// doesn't have to be normalized. +/// The default listener's orientation is (0, 0, -1). +/// +/// \param position New direction of the listener +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation); + +//////////////////////////////////////////////////////////// +/// \brief Get the current orientation of the listener in the scene +/// +/// \return The listener's direction +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfVector3f sfListener_getDirection(); + + +#endif // SFML_LISTENER_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Music.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Music.h new file mode 100755 index 0000000..604d02a --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Music.h @@ -0,0 +1,376 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_MUSIC_H +#define SFML_MUSIC_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/Audio/SoundStatus.h> +#include <SFML/Audio/Types.h> +#include <SFML/System/InputStream.h> +#include <SFML/System/Time.h> +#include <SFML/System/Vector3.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \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). +/// 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. +/// +/// \param filename Path of the music file to open +/// +/// \return A new sfMusic object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +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). +/// 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. +/// +/// \param data Pointer to the file data in memory +/// \param sizeInBytes Size of the data to load, in bytes +/// +/// \return A new sfMusic object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_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). +/// 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. +/// +/// \param stream Source stream to read from +/// +/// \return A new sfMusic object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfMusic* sfMusic_createFromStream(sfInputStream* stream); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a music +/// +/// \param music Music to destroy +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not a music is in loop mode +/// +/// \param music Music object +/// +/// \return sfTrue if the music is looping, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfMusic_getLoop(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the total duration of a music +/// +/// \param music Music object +/// +/// \return Music duration +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfTime sfMusic_getDuration(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Start or resume playing a music +/// +/// This function starts the music if it was stopped, resumes +/// it if it was paused, and restarts it from beginning if it +/// was it already playing. +/// This function uses its own thread so that it doesn't block +/// the rest of the program while the music is played. +/// +/// \param music Music object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_play(sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Pause a music +/// +/// This function pauses the music if it was playing, +/// otherwise (music already paused or stopped) it has no effect. +/// +/// \param music Music object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_pause(sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Stop playing a music +/// +/// This function stops the music if it was playing or paused, +/// and does nothing if it was already stopped. +/// It also resets the playing position (unlike sfMusic_pause). +/// +/// \param music Music object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_stop(sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Return the number of channels of a music +/// +/// 1 channel means a mono sound, 2 means stereo, etc. +/// +/// \param music Music object +/// +/// \return Number of channels +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfMusic_getChannelCount(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the sample rate of a music +/// +/// The sample rate is the number of audio samples played per +/// second. The higher, the better the quality. +/// +/// \param music Music object +/// +/// \return Sample rate, in number of samples per second +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfMusic_getSampleRate(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the current status of a music (stopped, paused, playing) +/// +/// \param music Music object +/// +/// \return Current status +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundStatus sfMusic_getStatus(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the current playing position of a music +/// +/// \param music Music object +/// +/// \return Current playing position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfTime sfMusic_getPlayingOffset(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Set the pitch of a music +/// +/// The pitch represents the perceived fundamental frequency +/// of a sound; thus you can make a music more acute or grave +/// by changing its pitch. A side effect of changing the pitch +/// is to modify the playing speed of the music as well. +/// The default value for the pitch is 1. +/// +/// \param music Music object +/// \param pitch New pitch to apply to the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setPitch(sfMusic* music, float pitch); + +//////////////////////////////////////////////////////////// +/// \brief Set the volume of a music +/// +/// The volume is a value between 0 (mute) and 100 (full volume). +/// The default value for the volume is 100. +/// +/// \param music Music object +/// \param volume Volume of the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setVolume(sfMusic* music, float volume); + +//////////////////////////////////////////////////////////// +/// \brief Set the 3D position of a music in the audio scene +/// +/// Only musics with one channel (mono musics) can be +/// spatialized. +/// The default position of a music is (0, 0, 0). +/// +/// \param music Music object +/// \param position Position of the music in the scene +// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setPosition(sfMusic* music, sfVector3f position); + +//////////////////////////////////////////////////////////// +/// \brief Make a musics's position relative to the listener or absolute +/// +/// Making a music relative to the listener will ensure that it will always +/// be played the same way regardless the position of the listener. +/// This can be useful for non-spatialized musics, musics that are +/// produced by the listener, or musics attached to it. +/// The default value is false (position is absolute). +/// +/// \param music Music object +/// \param relative sfTrue to set the position relative, sfFalse to set it absolute +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative); + +//////////////////////////////////////////////////////////// +/// \brief Set the minimum distance of a music +/// +/// The "minimum distance" of a music is the maximum +/// distance at which it is heard at its maximum volume. Further +/// than the minimum distance, it will start to fade out according +/// to its attenuation factor. A value of 0 ("inside the head +/// of the listener") is an invalid value and is forbidden. +/// The default value of the minimum distance is 1. +/// +/// \param music Music object +/// \param distance New minimum distance of the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setMinDistance(sfMusic* music, float distance); + +//////////////////////////////////////////////////////////// +/// \brief Set the attenuation factor of a music +/// +/// The attenuation is a multiplicative factor which makes +/// the music more or less loud according to its distance +/// from the listener. An attenuation of 0 will produce a +/// non-attenuated music, i.e. its volume will always be the same +/// whether it is heard from near or from far. On the other hand, +/// an attenuation value such as 100 will make the music fade out +/// very quickly as it gets further from the listener. +/// The default value of the attenuation is 1. +/// +/// \param music Music object +/// \param attenuation New attenuation factor of the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setAttenuation(sfMusic* music, float attenuation); + +//////////////////////////////////////////////////////////// +/// \brief Change the current playing position of a music +/// +/// The playing position can be changed when the music is +/// either paused or playing. +/// +/// \param music Music object +/// \param timeOffset New playing position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset); + +//////////////////////////////////////////////////////////// +/// \brief Get the pitch of a music +/// +/// \param music Music object +/// +/// \return Pitch of the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfMusic_getPitch(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the volume of a music +/// +/// \param music Music object +/// +/// \return Volume of the music, in the range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfMusic_getVolume(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the 3D position of a music in the audio scene +/// +/// \param music Music object +/// +/// \return Position of the music in the world +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfVector3f sfMusic_getPosition(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a music's position is relative to the +/// listener or is absolute +/// +/// \param music Music object +/// +/// \return sfTrue if the position is relative, sfFalse if it's absolute +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfMusic_isRelativeToListener(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the minimum distance of a music +/// +/// \param music Music object +/// +/// \return Minimum distance of the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfMusic_getMinDistance(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Get the attenuation factor of a music +/// +/// \param music Music object +/// +/// \return Attenuation factor of the music +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfMusic_getAttenuation(const sfMusic* music); + + +#endif // SFML_MUSIC_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Sound.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Sound.h new file mode 100755 index 0000000..e3000af --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Sound.h @@ -0,0 +1,331 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOUND_H +#define SFML_SOUND_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/Audio/SoundStatus.h> +#include <SFML/Audio/Types.h> +#include <SFML/System/Time.h> +#include <SFML/System/Vector3.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound +/// +/// \return A new sfSound object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSound* sfSound_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound by copying an existing one +/// +/// \param sound Sound to copy +/// +/// \return A new sfSound object which is a copy of \a sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSound* sfSound_copy(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a sound +/// +/// \param sound Sound to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_destroy(sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Start or resume playing a sound +/// +/// This function starts the sound if it was stopped, resumes +/// it if it was paused, and restarts it from beginning if it +/// was it already playing. +/// This function uses its own thread so that it doesn't block +/// the rest of the program while the sound is played. +/// +/// \param sound Sound object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_play(sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Pause a sound +/// +/// This function pauses the sound if it was playing, +/// otherwise (sound already paused or stopped) it has no effect. +/// +/// \param sound Sound object +/// +//////////////////////////////////////////////////////////// +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). +/// +/// \param sound Sound object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_stop(sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Set the source buffer containing the audio data to play +/// +/// It is important to note that the sound buffer is not copied, +/// thus the sfSoundBuffer object must remain alive as long +/// as it is attached to the sound. +/// +/// \param sound Sound object +/// \param buffer Sound buffer to attach to the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setBuffer(sfSound* sound, const sfSoundBuffer* buffer); + +//////////////////////////////////////////////////////////// +/// \brief Get the audio buffer attached to a sound +/// +/// \param sound Sound object +/// +/// \return Sound buffer attached to the sound (can be NULL) +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not a sound is in loop mode +/// +/// \param sound Sound object +/// +/// \return sfTrue if the sound is looping, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfSound_getLoop(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Get the current status of a sound (stopped, paused, playing) +/// +/// \param sound Sound object +/// +/// \return Current status +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundStatus sfSound_getStatus(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Set the pitch of a sound +/// +/// The pitch represents the perceived fundamental frequency +/// of a sound; thus you can make a sound more acute or grave +/// by changing its pitch. A side effect of changing the pitch +/// is to modify the playing speed of the sound as well. +/// The default value for the pitch is 1. +/// +/// \param sound Sound object +/// \param pitch New pitch to apply to the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setPitch(sfSound* sound, float pitch); + +//////////////////////////////////////////////////////////// +/// \brief Set the volume of a sound +/// +/// The volume is a value between 0 (mute) and 100 (full volume). +/// The default value for the volume is 100. +/// +/// \param sound Sound object +/// \param volume Volume of the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setVolume(sfSound* sound, float volume); + +//////////////////////////////////////////////////////////// +/// \brief Set the 3D position of a sound in the audio scene +/// +/// Only sounds with one channel (mono sounds) can be +/// spatialized. +/// The default position of a sound is (0, 0, 0). +/// +/// \param sound Sound object +/// \param position Position of the sound in the scene +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setPosition(sfSound* sound, sfVector3f position); + +//////////////////////////////////////////////////////////// +/// \brief Make the sound's position relative to the listener or absolute +/// +/// Making a sound relative to the listener will ensure that it will always +/// be played the same way regardless the position of the listener. +/// This can be useful for non-spatialized sounds, sounds that are +/// produced by the listener, or sounds attached to it. +/// The default value is false (position is absolute). +/// +/// \param sound Sound object +/// \param relative sfTrue to set the position relative, sfFalse to set it absolute +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setRelativeToListener(sfSound* sound, sfBool relative); + +//////////////////////////////////////////////////////////// +/// \brief Set the minimum distance of a sound +/// +/// The "minimum distance" of a sound is the maximum +/// distance at which it is heard at its maximum volume. Further +/// than the minimum distance, it will start to fade out according +/// to its attenuation factor. A value of 0 ("inside the head +/// of the listener") is an invalid value and is forbidden. +/// The default value of the minimum distance is 1. +/// +/// \param sound Sound object +/// \param distance New minimum distance of the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setMinDistance(sfSound* sound, float distance); + +//////////////////////////////////////////////////////////// +/// \brief Set the attenuation factor of a sound +/// +/// The attenuation is a multiplicative factor which makes +/// the sound more or less loud according to its distance +/// from the listener. An attenuation of 0 will produce a +/// non-attenuated sound, i.e. its volume will always be the same +/// whether it is heard from near or from far. On the other hand, +/// an attenuation value such as 100 will make the sound fade out +/// very quickly as it gets further from the listener. +/// The default value of the attenuation is 1. +/// +/// \param sound Sound object +/// \param attenuation New attenuation factor of the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setAttenuation(sfSound* sound, float attenuation); + +//////////////////////////////////////////////////////////// +/// \brief Change the current playing position of a sound +/// +/// The playing position can be changed when the sound is +/// either paused or playing. +/// +/// \param sound Sound object +/// \param timeOffset New playing position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSound_setPlayingOffset(sfSound* sound, sfTime timeOffset); + +//////////////////////////////////////////////////////////// +/// \brief Get the pitch of a sound +/// +/// \param sound Sound object +/// +/// \return Pitch of the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSound_getPitch(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Get the volume of a sound +/// +/// \param sound Sound object +/// +/// \return Volume of the sound, in the range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSound_getVolume(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Get the 3D position of a sound in the audio scene +/// +/// \param sound Sound object +/// +/// \return Position of the sound in the world +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfVector3f sfSound_getPosition(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a sound's position is relative to the +/// listener or is absolute +/// +/// \param sound Sound object +/// +/// \return sfTrue if the position is relative, sfFalse if it's absolute +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Get the minimum distance of a sound +/// +/// \param sound Sound object +/// +/// \return Minimum distance of the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSound_getMinDistance(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Get the attenuation factor of a sound +/// +/// \param sound Sound object +/// +/// \return Attenuation factor of the sound +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSound_getAttenuation(const sfSound* sound); + +//////////////////////////////////////////////////////////// +/// \brief Get the current playing position of a sound +/// +/// \param sound Sound object +/// +/// \return Current playing position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfTime sfSound_getPlayingOffset(const sfSound* sound); + + +#endif // SFML_SOUND_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundBuffer.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundBuffer.h new file mode 100755 index 0000000..4ec13e5 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundBuffer.h @@ -0,0 +1,195 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOUNDBUFFER_H +#define SFML_SOUNDBUFFER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/Audio/Types.h> +#include <SFML/System/InputStream.h> +#include <SFML/System/Time.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound buffer and load it from a file +/// +/// 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. +/// +/// \param filename Path of the sound file to load +/// +/// \return A new sfSoundBuffer object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename); + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound buffer and load it from a file in memory +/// +/// 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. +/// +/// \param data Pointer to the file data in memory +/// \param sizeInBytes Size of the data to load, in bytes +/// +/// \return A new sfSoundBuffer object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInBytes); + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound buffer and load it from a custom stream +/// +/// 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. +/// +/// \param stream Source stream to read from +/// +/// \return A new sfSoundBuffer object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream); + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound buffer and load it from an array of samples in memory +/// +/// The assumed format of the audio samples is 16 bits signed integer +/// (sfInt16). +/// +/// \param samples Pointer to the array of samples in memory +/// \param sampleCount Number of samples in the array +/// \param channelCount Number of channels (1 = mono, 2 = stereo, ...) +/// \param sampleRate Sample rate (number of samples to play per second) +/// +/// \return A new sfSoundBuffer object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +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 +/// +/// \param soundBuffer Sound buffer to copy +/// +/// \return A new sfSoundBuffer object which is a copy of \a soundBuffer +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(const sfSoundBuffer* soundBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a sound buffer +/// +/// \param soundBuffer Sound buffer to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Save a sound buffer to an audio file +/// +/// 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. +/// +/// \param soundBuffer Sound buffer object +/// \param filename Path of the sound file to write +/// +/// \return sfTrue if saving succeeded, sfFalse if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename); + +//////////////////////////////////////////////////////////// +/// \brief Get the array of audio samples stored in a sound buffer +/// +/// The format of the returned samples is 16 bits signed integer +/// (sfInt16). The total number of samples in this array +/// is given by the sfSoundBuffer_getSampleCount function. +/// +/// \param soundBuffer Sound buffer object +/// +/// \return Read-only pointer to the array of sound samples +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param soundBuffer Sound buffer object +/// +/// \return Number of samples +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Get the sample rate of a sound buffer +/// +/// The sample rate is the number of samples played per second. +/// The higher, the better the quality (for example, 44100 +/// samples/s is CD quality). +/// +/// \param soundBuffer Sound buffer object +/// +/// \return Sample rate (number of samples per second) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Get the number of channels used by a sound buffer +/// +/// If the sound is mono then the number of channels will +/// be 1, 2 for stereo, etc. +/// +/// \param soundBuffer Sound buffer object +/// +/// \return Number of channels +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Get the total duration of a sound buffer +/// +/// \param soundBuffer Sound buffer object +/// +/// \return Sound duration +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer); + + +#endif // SFML_SOUNDBUFFER_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundBufferRecorder.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundBufferRecorder.h new file mode 100755 index 0000000..c20f172 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundBufferRecorder.h @@ -0,0 +1,105 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOUNDBUFFERRECORDER_H +#define SFML_SOUNDBUFFERRECORDER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/Audio/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound buffer recorder +/// +/// \return A new sfSoundBufferRecorder object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a sound buffer recorder +/// +/// \param soundBufferRecorder Sound buffer recorder to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder); + +//////////////////////////////////////////////////////////// +/// \brief Start the capture of a sound recorder recorder +/// +/// The \a sampleRate parameter defines the number of audio samples +/// captured per second. The higher, the better the quality +/// (for example, 44100 samples/sec is CD quality). +/// This function uses its own thread so that it doesn't block +/// the rest of the program while the capture runs. +/// Please note that only one capture can happen at the same time. +/// +/// \param soundBufferRecorder Sound buffer recorder object +/// \param sampleRate Desired capture rate, in number of samples per second +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate); + +//////////////////////////////////////////////////////////// +/// \brief Stop the capture of a sound recorder +/// +/// \param soundBufferRecorder Sound buffer recorder object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundBufferRecorder_stop(sfSoundBufferRecorder* soundBufferRecorder); + +//////////////////////////////////////////////////////////// +/// \brief Get the sample rate of a sound buffer recorder +/// +/// The sample rate defines the number of audio samples +/// captured per second. The higher, the better the quality +/// (for example, 44100 samples/sec is CD quality). +/// +/// \param soundBufferRecorder Sound buffer recorder object +/// +/// \return Sample rate, in samples per second +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBufferRecorder* soundBufferRecorder); + +//////////////////////////////////////////////////////////// +/// \brief Get the sound buffer containing the captured audio data +/// +/// The sound buffer is valid only after the capture has ended. +/// This function provides a read-only access to the internal +/// sound buffer, but it can be copied if you need to +/// make any modification to it. +/// +/// \param soundBufferRecorder Sound buffer recorder object +/// +/// \return Read-only access to the sound buffer +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder); + + +#endif // SFML_SOUNDBUFFERRECORDER_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundRecorder.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundRecorder.h new file mode 100755 index 0000000..6395574 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundRecorder.h @@ -0,0 +1,116 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOUNDRECORDER_H +#define SFML_SOUNDRECORDER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/Audio/Types.h> +#include <stddef.h> + + +typedef sfBool (*sfSoundRecorderStartCallback)(void*); ///< Type of the callback used when starting a capture +typedef sfBool (*sfSoundRecorderProcessCallback)(const sfInt16*, size_t, void*); ///< Type of the callback used to process audio data +typedef void (*sfSoundRecorderStopCallback)(void*); ///< Type of the callback used when stopping a capture + + +//////////////////////////////////////////////////////////// +/// \brief Construct a new sound recorder from callback functions +/// +/// \param onStart Callback function which will be called when a new capture starts (can be NULL) +/// \param onProcess Callback function which will be called each time there's audio data to process +/// \param onStop Callback function which will be called when the current capture stops (can be NULL) +/// \param userData Data to pass to the callback function (can be NULL) +/// +/// \return A new sfSoundRecorder object (NULL if failed) +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_create(sfSoundRecorderStartCallback onStart, + sfSoundRecorderProcessCallback onProcess, + sfSoundRecorderStopCallback onStop, + void* userData); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a sound recorder +/// +/// \param soundRecorder Sound recorder to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder); + +//////////////////////////////////////////////////////////// +/// \brief Start the capture of a sound recorder +/// +/// The \a sampleRate parameter defines the number of audio samples +/// captured per second. The higher, the better the quality +/// (for example, 44100 samples/sec is CD quality). +/// This function uses its own thread so that it doesn't block +/// the rest of the program while the capture runs. +/// Please note that only one capture can happen at the same time. +/// +/// \param soundRecorder Sound recorder object +/// \param sampleRate Desired capture rate, in number of samples per second +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate); + +//////////////////////////////////////////////////////////// +/// \brief Stop the capture of a sound recorder +/// +/// \param soundRecorder Sound recorder object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundRecorder_stop(sfSoundRecorder* soundRecorder); + +//////////////////////////////////////////////////////////// +/// \brief Get the sample rate of a sound recorder +/// +/// The sample rate defines the number of audio samples +/// captured per second. The higher, the better the quality +/// (for example, 44100 samples/sec is CD quality). +/// +/// \param soundRecorder Sound recorder object +/// +/// \return Sample rate, in samples per second +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder); + +//////////////////////////////////////////////////////////// +/// \brief Check if the system supports audio capture +/// +/// This function should always be called before using +/// the audio capture features. If it returns false, then +/// any attempt to use sfSoundRecorder will fail. +/// +/// \return sfTrue if audio capture is supported, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void); + + +#endif // SFML_SOUNDRECORDER_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundStatus.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundStatus.h new file mode 100755 index 0000000..3e16a42 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundStatus.h @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOUNDSTATUS_H +#define SFML_SOUNDSTATUS_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Enumeration of statuses for sounds and musics +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfStopped, ///< Sound / music is not playing + sfPaused, ///< Sound / music is paused + sfPlaying ///< Sound / music is playing +} sfSoundStatus; + + +#endif // SFML_SOUNDSTATUS_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundStream.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundStream.h new file mode 100755 index 0000000..e06f14b --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/SoundStream.h @@ -0,0 +1,347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOUNDSTREAM_H +#define SFML_SOUNDSTREAM_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Audio/Export.h> +#include <SFML/Audio/SoundStatus.h> +#include <SFML/Audio/Types.h> +#include <SFML/System/Time.h> +#include <SFML/System/Vector3.h> + + +//////////////////////////////////////////////////////////// +/// \brief defines the data to fill by the OnGetData callback +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + 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 +typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< Type of the callback used to seek in a sound stream + + +//////////////////////////////////////////////////////////// +/// \brief Create a new sound stream +/// +/// \param onGetData Function called when the stream needs more data (can't be NULL) +/// \param onSeek Function called when the stream seeks (can't be NULL) +/// \param channelCount Number of channels to use (1 = mono, 2 = stereo) +/// \param sampleRate Sample rate of the sound (44100 = CD quality) +/// \param userData Data to pass to the callback functions +/// +/// \return A new sfSoundStream object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData, + sfSoundStreamSeekCallback onSeek, + unsigned int channelCount, + unsigned int sampleRate, + void* userData); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a sound stream +/// +/// \param soundStream Sound stream to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_destroy(sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Start or resume playing a sound stream +/// +/// This function starts the stream if it was stopped, resumes +/// it if it was paused, and restarts it from beginning if it +/// was it already playing. +/// This function uses its own thread so that it doesn't block +/// the rest of the program while the music is played. +/// +/// \param soundStream Sound stream object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_play(sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Pause a sound stream +/// +/// This function pauses the stream if it was playing, +/// otherwise (stream already paused or stopped) it has no effect. +/// +/// \param soundStream Sound stream object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_pause(sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Stop playing a sound stream +/// +/// This function stops the stream if it was playing or paused, +/// and does nothing if it was already stopped. +/// It also resets the playing position (unlike sfSoundStream_pause). +/// +/// \param soundStream Sound stream object +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_stop(sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the current status of a sound stream (stopped, paused, playing) +/// +/// \param soundStream Sound stream object +/// +/// \return Current status +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfSoundStatus sfSoundStream_getStatus(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Return the number of channels of a sound stream +/// +/// 1 channel means a mono sound, 2 means stereo, etc. +/// +/// \param soundStream Sound stream object +/// +/// \return Number of channels +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfSoundStream_getChannelCount(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the sample rate of a sound stream +/// +/// The sample rate is the number of audio samples played per +/// second. The higher, the better the quality. +/// +/// \param soundStream Sound stream object +/// +/// \return Sample rate, in number of samples per second +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API unsigned int sfSoundStream_getSampleRate(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Set the pitch of a sound stream +/// +/// The pitch represents the perceived fundamental frequency +/// of a sound; thus you can make a stream more acute or grave +/// by changing its pitch. A side effect of changing the pitch +/// is to modify the playing speed of the stream as well. +/// The default value for the pitch is 1. +/// +/// \param soundStream Sound stream object +/// \param pitch New pitch to apply to the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setPitch(sfSoundStream* soundStream, float pitch); + +//////////////////////////////////////////////////////////// +/// \brief Set the volume of a sound stream +/// +/// The volume is a value between 0 (mute) and 100 (full volume). +/// The default value for the volume is 100. +/// +/// \param soundStream Sound stream object +/// \param volume Volume of the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setVolume(sfSoundStream* soundStream, float volume); + +//////////////////////////////////////////////////////////// +/// \brief Set the 3D position of a sound stream in the audio scene +/// +/// Only streams with one channel (mono streams) can be +/// spatialized. +/// The default position of a stream is (0, 0, 0). +/// +/// \param soundStream Sound stream object +/// \param position Position of the stream in the scene +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVector3f position); + +//////////////////////////////////////////////////////////// +/// \brief Make a sound stream's position relative to the listener or absolute +/// +/// Making a stream relative to the listener will ensure that it will always +/// be played the same way regardless the position of the listener. +/// This can be useful for non-spatialized streams, streams that are +/// produced by the listener, or streams attached to it. +/// The default value is false (position is absolute). +/// +/// \param soundStream Sound stream object +/// \param relative sfTrue to set the position relative, sfFalse to set it absolute +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative); + +//////////////////////////////////////////////////////////// +/// \brief Set the minimum distance of a sound stream +/// +/// The "minimum distance" of a stream is the maximum +/// distance at which it is heard at its maximum volume. Further +/// than the minimum distance, it will start to fade out according +/// to its attenuation factor. A value of 0 ("inside the head +/// of the listener") is an invalid value and is forbidden. +/// The default value of the minimum distance is 1. +/// +/// \param soundStream Sound stream object +/// \param distance New minimum distance of the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setMinDistance(sfSoundStream* soundStream, float distance); + +//////////////////////////////////////////////////////////// +/// \brief Set the attenuation factor of a sound stream +/// +/// The attenuation is a multiplicative factor which makes +/// the stream more or less loud according to its distance +/// from the listener. An attenuation of 0 will produce a +/// non-attenuated stream, i.e. its volume will always be the same +/// whether it is heard from near or from far. On the other hand, +/// an attenuation value such as 100 will make the stream fade out +/// very quickly as it gets further from the listener. +/// The default value of the attenuation is 1. +/// +/// \param soundStream Sound stream object +/// \param attenuation New attenuation factor of the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setAttenuation(sfSoundStream* soundStream, float attenuation); + +//////////////////////////////////////////////////////////// +/// \brief Change the current playing position of a sound stream +/// +/// The playing position can be changed when the stream is +/// either paused or playing. +/// +/// \param soundStream Sound stream object +/// \param timeOffset New playing position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset); + +//////////////////////////////////////////////////////////// +/// \brief Set whether or not a sound stream should loop after reaching the end +/// +/// If set, the stream will restart from beginning after +/// reaching the end and so on, until it is stopped or +/// sfSoundStream_setLoop(stream, sfFalse) is called. +/// The default looping state for sound streams is false. +/// +/// \param soundStream Sound stream object +/// \param loop sfTrue to play in loop, sfFalse to play once +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop); + +//////////////////////////////////////////////////////////// +/// \brief Get the pitch of a sound stream +/// +/// \param soundStream Sound stream object +/// +/// \return Pitch of the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSoundStream_getPitch(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the volume of a sound stream +/// +/// \param soundStream Sound stream object +/// +/// \return Volume of the stream, in the range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSoundStream_getVolume(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the 3D position of a sound stream in the audio scene +/// +/// \param soundStream Sound stream object +/// +/// \return Position of the stream in the world +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a sound stream's position is relative to the +/// listener or is absolute +/// +/// \param soundStream Sound stream object +/// +/// \return sfTrue if the position is relative, sfFalse if it's absolute +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the minimum distance of a sound stream +/// +/// \param soundStream Sound stream object +/// +/// \return Minimum distance of the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSoundStream_getMinDistance(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the attenuation factor of a sound stream +/// +/// \param soundStream Sound stream object +/// +/// \return Attenuation factor of the stream +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API float sfSoundStream_getAttenuation(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not a sound stream is in loop mode +/// +/// \param soundStream Sound stream object +/// +/// \return sfTrue if the music is looping, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream); + +//////////////////////////////////////////////////////////// +/// \brief Get the current playing position of a sound stream +/// +/// \param soundStream Sound stream object +/// +/// \return Current playing position +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfTime sfSoundStream_getPlayingOffset(const sfSoundStream* soundStream); + + +#endif // SFML_SOUNDSTREAM_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Types.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Types.h new file mode 100755 index 0000000..f90a002 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Audio/Types.h @@ -0,0 +1,36 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_AUDIO_TYPES_H +#define SFML_AUDIO_TYPES_H + + +typedef struct sfMusic sfMusic; +typedef struct sfSound sfSound; +typedef struct sfSoundBuffer sfSoundBuffer; +typedef struct sfSoundBufferRecorder sfSoundBufferRecorder; +typedef struct sfSoundRecorder sfSoundRecorder; +typedef struct sfSoundStream sfSoundStream; + + +#endif // SFML_AUDIO_TYPES_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Config.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Config.h new file mode 100755 index 0000000..8c97c70 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Config.h @@ -0,0 +1,141 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_CONFIG_H +#define SFML_CONFIG_H + + +//////////////////////////////////////////////////////////// +// Define the CSFML version +//////////////////////////////////////////////////////////// +#define CSFML_VERSION_MAJOR 2 +#define CSFML_VERSION_MINOR 1 + + +//////////////////////////////////////////////////////////// +// Identify the operating system +//////////////////////////////////////////////////////////// +#if defined(_WIN32) || defined(__WIN32__) + + // Windows + #define CSFML_SYSTEM_WINDOWS + +#elif defined(linux) || defined(__linux) + + // Linux + #define CSFML_SYSTEM_LINUX + +#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh) + + // MacOS + #define CSFML_SYSTEM_MACOS + +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + + // FreeBSD + #define CSFML_SYSTEM_FREEBSD + +#else + + // Unsupported system + #error This operating system is not supported by SFML library + +#endif + + +//////////////////////////////////////////////////////////// +// Define helpers to create portable import / export macros for each module +//////////////////////////////////////////////////////////// +#if defined(CSFML_SYSTEM_WINDOWS) + + // Windows compilers need specific (and different) keywords for export and import + #define CSFML_API_EXPORT extern "C" __declspec(dllexport) + #define CSFML_API_IMPORT extern __declspec(dllimport) + + // For Visual C++ compilers, we also need to turn off this annoying C4251 warning + #ifdef _MSC_VER + + #pragma warning(disable : 4251) + + #endif + +#else // Linux, FreeBSD, Mac OS X + + #if __GNUC__ >= 4 + + // GCC 4 has special keywords for showing/hidding symbols, + // the same keyword is used for both importing and exporting + #define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default"))) + #define CSFML_API_IMPORT extern __attribute__ ((__visibility__ ("default"))) + + #else + + // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported + #define CSFML_API_EXPORT extern "C" + #define CSFML_API_IMPORT extern + + #endif + +#endif + + +//////////////////////////////////////////////////////////// +// Define a portable boolean type +//////////////////////////////////////////////////////////// +typedef int sfBool; +#define sfFalse 0 +#define sfTrue 1 + + +//////////////////////////////////////////////////////////// +// Define portable fixed-size types +//////////////////////////////////////////////////////////// + +// All "common" platforms use the same size for char, short and int +// (basically there are 3 types for 3 sizes, so no other match is possible), +// we can use them without doing any kind of check + +// 8 bits integer types +typedef signed char sfInt8; +typedef unsigned char sfUint8; + +// 16 bits integer types +typedef signed short sfInt16; +typedef unsigned short sfUint16; + +// 32 bits integer types +typedef signed int sfInt32; +typedef unsigned int sfUint32; + +// 64 bits integer types +#if defined(_MSC_VER) + typedef signed __int64 sfInt64; + typedef unsigned __int64 sfUint64; +#else + typedef signed long long sfInt64; + typedef unsigned long long sfUint64; +#endif + + +#endif // SFML_CONFIG_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics.h new file mode 100755 index 0000000..8757271 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics.h @@ -0,0 +1,58 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_GRAPHICS_H +#define SFML_GRAPHICS_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// + +#include <SFML/Window.h> +#include <SFML/Graphics/BlendMode.h> +#include <SFML/Graphics/CircleShape.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/ConvexShape.h> +#include <SFML/Graphics/Font.h> +#include <SFML/Graphics/Glyph.h> +#include <SFML/Graphics/Image.h> +#include <SFML/Graphics/PrimitiveType.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/RectangleShape.h> +#include <SFML/Graphics/RenderStates.h> +#include <SFML/Graphics/RenderWindow.h> +#include <SFML/Graphics/RenderTexture.h> +#include <SFML/Graphics/Shader.h> +#include <SFML/Graphics/Shape.h> +#include <SFML/Graphics/Sprite.h> +#include <SFML/Graphics/Text.h> +#include <SFML/Graphics/Texture.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Transformable.h> +#include <SFML/Graphics/Vertex.h> +#include <SFML/Graphics/VertexArray.h> +#include <SFML/Graphics/View.h> + + +#endif // SFML_GRAPHICS_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/BlendMode.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/BlendMode.h new file mode 100755 index 0000000..e46f563 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/BlendMode.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_BLENDMODE_H +#define SFML_BLENDMODE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Available blending modes for drawing +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfBlendAlpha, ///< Pixel = Src * a + Dest * (1 - a) + sfBlendAdd, ///< Pixel = Src + Dest + sfBlendMultiply, ///< Pixel = Src * Dest + sfBlendNone ///< No blending +} sfBlendMode; + + +#endif // SFML_BLENDMODE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/CircleShape.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/CircleShape.h new file mode 100755 index 0000000..a37277b --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/CircleShape.h @@ -0,0 +1,431 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_CIRCLESHAPE_H +#define SFML_CIRCLESHAPE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new circle shape +/// +/// \return A new sfCircleShape object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing circle shape +/// +/// \param shape Shape to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing circle Shape +/// +/// \param Shape Shape to delete +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a circle shape +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 circle Shape object is (0, 0). +/// +/// \param shape Shape object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_setOrigin(sfCircleShape* shape, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a circle shape +/// +/// \param shape Shape object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPosition(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a circle shape +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param shape Shape object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfCircleShape_getRotation(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a circle shape +/// +/// \param shape Shape object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfCircleShape_getScale(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a circle shape +/// +/// \param shape Shape object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param shape Shape object +/// \param offset 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. +/// +/// \param shape Shape object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param shape Shape object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_scale(sfCircleShape* shape, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a circle shape +/// +/// \param shape Shape object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfCircleShape_getTransform(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a circle shape +/// +/// \param shape Shape object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfCircleShape_getInverseTransform(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Change the source texture of a circle shape +/// +/// The \a texture argument refers to a texture that must +/// exist as long as the shape uses it. Indeed, the shape +/// doesn't store its own copy of the texture, but rather keeps +/// a pointer to the one that you passed to this function. +/// If the source texture is destroyed and the shape tries to +/// use it, the behaviour is undefined. +/// \a texture can be NULL to disable texturing. +/// If \a resetRect is true, the TextureRect property of +/// the shape is automatically adjusted to the size of the new +/// texture. If it is false, the texture rect is left unchanged. +/// +/// \param shape Shape object +/// \param texture New texture +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Set the sub-rectangle of the texture that a circle shape will display +/// +/// The texture rect is useful when you don't want to display +/// the whole texture, but rather a part of it. +/// By default, the texture rect covers the entire texture. +/// +/// \param shape Shape object +/// \param rect Rectangle defining the region of the texture to display +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_setTextureRect(sfCircleShape* shape, sfIntRect rect); + +//////////////////////////////////////////////////////////// +/// \brief Set the fill color of a circle 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 sfTransparent to make the inside of +/// the shape transparent, and have the outline alone. +/// By default, the shape's fill color is opaque white. +/// +/// \param shape Shape object +/// \param color New color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_setFillColor(sfCircleShape* shape, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Set the outline color of a circle shape +/// +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the thickness of a circle shape's outline +/// +/// This number cannot be negative. Using zero disables +/// the outline. +/// By default, the outline thickness is 0. +/// +/// \param shape Shape object +/// \param thickness New outline thickness +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_setOutlineThickness(sfCircleShape* shape, float thickness); + +//////////////////////////////////////////////////////////// +/// \brief Get the source texture of a circle shape +/// +/// If the shape has no source texture, a NULL pointer is returned. +/// The returned pointer is const, which means that you can't +/// modify the texture when you retrieve it with this function. +/// +/// \param shape Shape object +/// +/// \return Pointer to the shape's texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfCircleShape_getTexture(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the sub-rectangle of the texture displayed by a circle shape +/// +/// \param shape Shape object +/// +/// \return Texture rectangle of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfCircleShape_getTextureRect(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the fill color of a circle shape +/// +/// \param shape Shape object +/// +/// \return Fill color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfCircleShape_getFillColor(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline color of a circle shape +/// +/// \param shape Shape object +/// +/// \return Outline color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfCircleShape_getOutlineColor(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline thickness of a circle shape +/// +/// \param shape Shape object +/// +/// \return Outline thickness of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfCircleShape_getOutlineThickness(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the total number of points of a circle shape +/// +/// \param shape Shape object +/// +/// \return Number of points of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get a point of a circle 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] +/// +/// \return Index-th point of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index); + +//////////////////////////////////////////////////////////// +/// \brief Set the radius of a circle +/// +/// \param shape Shape object +/// \param radius New radius of the circle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_setRadius(sfCircleShape* shape, float radius); + +//////////////////////////////////////////////////////////// +/// \brief Get the radius of a circle +/// +/// \param shape Shape object +/// +/// \return Radius of the circle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfCircleShape_getRadius(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Set the number of points of a circle +/// +/// \param shape Shape object +/// \param count New number of points of the circle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count); + +//////////////////////////////////////////////////////////// +/// \brief Get the local bounding rectangle of a circle shape +/// +/// The returned rectangle is in local coordinates, which means +/// that it ignores the transformations (translation, rotation, +/// scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// entity in the entity's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Local bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getLocalBounds(const sfCircleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the global bounding rectangle of a circle shape +/// +/// The returned rectangle is in global coordinates, which means +/// that it takes in account the transformations (translation, +/// rotation, scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// sprite in the global 2D world's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Global bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getGlobalBounds(const sfCircleShape* shape); + + +#endif // SFML_CIRCLESHAPE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Color.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Color.h new file mode 100755 index 0000000..f1bc1d6 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Color.h @@ -0,0 +1,106 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_COLOR_H +#define SFML_COLOR_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Utility class for manpulating RGBA colors +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfUint8 r; + sfUint8 g; + sfUint8 b; + sfUint8 a; +} sfColor; + + +CSFML_GRAPHICS_API sfColor sfBlack; ///< Black predefined color +CSFML_GRAPHICS_API sfColor sfWhite; ///< White predefined color +CSFML_GRAPHICS_API sfColor sfRed; ///< Red predefined color +CSFML_GRAPHICS_API sfColor sfGreen; ///< Green predefined color +CSFML_GRAPHICS_API sfColor sfBlue; ///< Blue predefined color +CSFML_GRAPHICS_API sfColor sfYellow; ///< Yellow predefined color +CSFML_GRAPHICS_API sfColor sfMagenta; ///< Magenta predefined color +CSFML_GRAPHICS_API sfColor sfCyan; ///< Cyan predefined color +CSFML_GRAPHICS_API sfColor sfTransparent; ///< Transparent (black) predefined color + + +//////////////////////////////////////////////////////////// +/// \brief Construct a color from its 3 RGB components +/// +/// \param red Red component (0 .. 255) +/// \param green Green component (0 .. 255) +/// \param blue Blue component (0 .. 255) +/// +/// \return sfColor constructed from the components +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue); + +//////////////////////////////////////////////////////////// +/// \brief Construct a color from its 4 RGBA components +/// +/// \param red Red component (0 .. 255) +/// \param green Green component (0 .. 255) +/// \param blue Blue component (0 .. 255) +/// \param alpha Alpha component (0 .. 255) +/// +/// \return sfColor constructed from the components +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha); + +//////////////////////////////////////////////////////////// +/// \brief Add two colors +/// +/// \param color1 First color +/// \param color2 Second color +/// +/// \return Component-wise saturated addition of the two colors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfColor_add(sfColor color1, sfColor color2); + +//////////////////////////////////////////////////////////// +/// \brief Modulate two colors +/// +/// \param color1 First color +/// \param color2 Second color +/// +/// \return Component-wise multiplication of the two colors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfColor_modulate(sfColor color1, sfColor color2); + + +#endif // SFML_COLOR_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/ConvexShape.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/ConvexShape.h new file mode 100755 index 0000000..bdac8c3 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/ConvexShape.h @@ -0,0 +1,430 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_CONVEXSHAPE_H +#define SFML_CONVEXSHAPE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new convex shape +/// +/// \return A new sfConvexShape object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing convex shape +/// +/// \param shape Shape to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing convex Shape +/// +/// \param Shape Shape to delete +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a convex shape +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 circle Shape object is (0, 0). +/// +/// \param shape Shape object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfConvexShape_setOrigin(sfConvexShape* shape, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a convex shape +/// +/// \param shape Shape object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPosition(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a convex shape +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param shape Shape object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfConvexShape_getRotation(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a convex shape +/// +/// \param shape Shape object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfConvexShape_getScale(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a convex shape +/// +/// \param shape Shape object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param shape Shape object +/// \param offset 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. +/// +/// \param shape Shape object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param shape Shape object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfConvexShape_scale(sfConvexShape* shape, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a convex shape +/// +/// \param shape shape object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfConvexShape_getTransform(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a convex shape +/// +/// \param shape shape object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfConvexShape_getInverseTransform(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Change the source texture of a convex shape +/// +/// The \a texture argument refers to a texture that must +/// exist as long as the shape uses it. Indeed, the shape +/// doesn't store its own copy of the texture, but rather keeps +/// a pointer to the one that you passed to this function. +/// If the source texture is destroyed and the shape tries to +/// use it, the behaviour is undefined. +/// \a texture can be NULL to disable texturing. +/// If \a resetRect is true, the TextureRect property of +/// the shape is automatically adjusted to the size of the new +/// texture. If it is false, the texture rect is left unchanged. +/// +/// \param shape Shape object +/// \param texture New texture +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Set the sub-rectangle of the texture that a convex shape will display +/// +/// The texture rect is useful when you don't want to display +/// the whole texture, but rather a part of it. +/// By default, the texture rect covers the entire texture. +/// +/// \param shape Shape object +/// \param rect Rectangle defining the region of the texture to display +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfConvexShape_setTextureRect(sfConvexShape* shape, sfIntRect rect); + +//////////////////////////////////////////////////////////// +/// \brief Set the fill color of a convex 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 sfTransparent to make the inside of +/// the shape transparent, and have the outline alone. +/// By default, the shape's fill color is opaque white. +/// +/// \param shape Shape object +/// \param color New color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfConvexShape_setFillColor(sfConvexShape* shape, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Set the outline color of a convex shape +/// +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the thickness of a convex shape's outline +/// +/// This number cannot be negative. Using zero disables +/// the outline. +/// By default, the outline thickness is 0. +/// +/// \param shape Shape object +/// \param thickness New outline thickness +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfConvexShape_setOutlineThickness(sfConvexShape* shape, float thickness); + +//////////////////////////////////////////////////////////// +/// \brief Get the source texture of a convex shape +/// +/// If the shape has no source texture, a NULL pointer is returned. +/// The returned pointer is const, which means that you can't +/// modify the texture when you retrieve it with this function. +/// +/// \param shape Shape object +/// +/// \return Pointer to the shape's texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfConvexShape_getTexture(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the sub-rectangle of the texture displayed by a convex shape +/// +/// \param shape Shape object +/// +/// \return Texture rectangle of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfConvexShape_getTextureRect(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the fill color of a convex shape +/// +/// \param shape Shape object +/// +/// \return Fill color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfConvexShape_getFillColor(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline color of a convex shape +/// +/// \param shape Shape object +/// +/// \return Outline color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfConvexShape_getOutlineColor(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline thickness of a convex shape +/// +/// \param shape Shape object +/// +/// \return Outline thickness of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfConvexShape_getOutlineThickness(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the total number of points of a convex shape +/// +/// \param shape Shape object +/// +/// \return Number of points of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get a point of a convex 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] +/// +/// \return Index-th point of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index); + +//////////////////////////////////////////////////////////// +/// \brief Set the number of points of a convex shap +/// +/// \a count must be greater than 2 to define a valid shape. +/// +/// \param shape Shape object +/// \param count New number of points of the shape +/// +//////////////////////////////////////////////////////////// +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 +/// number of points. The result is undefined if \a index is out +/// of the valid range. +/// +/// \param shape Shape object +/// \param index Index of the point to change, in range [0 .. GetPointCount() - 1] +/// \param point New point +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point); + +//////////////////////////////////////////////////////////// +/// \brief Get the local bounding rectangle of a convex shape +/// +/// The returned rectangle is in local coordinates, which means +/// that it ignores the transformations (translation, rotation, +/// scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// entity in the entity's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Local bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getLocalBounds(const sfConvexShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the global bounding rectangle of a convex shape +/// +/// The returned rectangle is in global coordinates, which means +/// that it takes in account the transformations (translation, +/// rotation, scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// sprite in the global 2D world's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Global bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getGlobalBounds(const sfConvexShape* shape); + + +#endif // SFML_CONVEXSHAPE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Export.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Export.h new file mode 100755 index 0000000..326e646 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Export.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_GRAPHICS_EXPORT_H +#define SFML_GRAPHICS_EXPORT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Config.h> + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(CSFML_GRAPHICS_EXPORTS) + + #define CSFML_GRAPHICS_API CSFML_API_EXPORT + +#else + + #define CSFML_GRAPHICS_API CSFML_API_IMPORT + +#endif + + +#endif // SFML_GRAPHICS_EXPORT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Font.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Font.h new file mode 100755 index 0000000..f8f3f25 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Font.h @@ -0,0 +1,136 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_FONT_H +#define SFML_FONT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Glyph.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/InputStream.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new font from a file +/// +/// \param filename Path of the font file to load +/// +/// \return A new sfFont object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFont* sfFont_createFromFile(const char* filename); + +//////////////////////////////////////////////////////////// +/// \brief Create a new image font a file in memory +/// +/// \param data Pointer to the file data in memory +/// \param sizeInBytes Size of the data to load, in bytes +/// +/// \return A new sfFont object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFont* sfFont_createFromMemory(const void* data, size_t sizeInBytes); + +//////////////////////////////////////////////////////////// +/// \brief Create a new image font a custom stream +/// +/// \param stream Source stream to read from +/// +/// \return A new sfFont object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFont* sfFont_createFromStream(sfInputStream* stream); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing font +/// +/// \param font Font to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFont* sfFont_copy(const sfFont* font); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing font +/// +/// \param font Font to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font); + +//////////////////////////////////////////////////////////// +/// \brief Get a glyph in a font +/// +/// \param font Source font +/// \param codePoint Unicode code point of the character to get +/// \param characterSize Character size, in pixels +/// \param bold Retrieve the bold version or the regular one? +/// +/// \return The corresponding glyph +/// +//////////////////////////////////////////////////////////// +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 +/// +/// \param font Source font +/// \param first Unicode code point of the first character +/// \param second Unicode code point of the second character +/// \param characterSize Character size, in pixels +/// +/// \return Kerning offset, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize); + +//////////////////////////////////////////////////////////// +/// \brief Get the line spacing value +/// +/// \param font Source font +/// \param characterSize Character size, in pixels +/// +/// \return Line spacing, in pixels +/// +//////////////////////////////////////////////////////////// +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 +/// +/// \param font Source font +/// \param characterSize Character size, in pixels +/// +/// \return Read-only pointer to the texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize); + + +#endif // SFML_IMAGE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Glyph.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Glyph.h new file mode 100755 index 0000000..a9b0ef7 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Glyph.h @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_GLYPH_H +#define SFML_GLYPH_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Rect.h> + + +//////////////////////////////////////////////////////////// +/// \brief sfGlyph describes a glyph (a visual character) +/// +//////////////////////////////////////////////////////////// +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 +} sfGlyph; + + +#endif // SFML_GLYPH_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Image.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Image.h new file mode 100755 index 0000000..4fbe801 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Image.h @@ -0,0 +1,274 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_IMAGE_H +#define SFML_IMAGE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/InputStream.h> +#include <SFML/System/Vector2.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create an image +/// +/// This image is filled with black pixels. +/// +/// \param width Width of the image +/// \param height Height of the image +/// +/// \return A new sfImage object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_create(unsigned int width, unsigned int height); + +//////////////////////////////////////////////////////////// +/// \brief Create an image and fill it with a unique color +/// +/// \param width Width of the image +/// \param height Height of the image +/// \param color Fill color +/// +/// \return A new sfImage object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Create an image from an array of pixels +/// +/// The \a pixel array is assumed to contain 32-bits RGBA pixels, +/// and have the given \a width and \a height. If not, this is +/// an undefined behaviour. +/// If \a pixels is null, an empty image is created. +/// +/// \param width Width of the image +/// \param height Height of the image +/// \param pixels Array of pixels to copy to the image +/// +/// \return A new sfImage object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* pixels); + +//////////////////////////////////////////////////////////// +/// \brief Create an image from a file on disk +/// +/// The supported image formats are bmp, png, tga, jpg, gif, +/// psd, hdr and pic. Some format options are not supported, +/// like progressive jpeg. +/// If this function fails, the image is left unchanged. +/// +/// \param filename Path of the image file to load +/// +/// \return A new sfImage object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_createFromFile(const char* filename); + +//////////////////////////////////////////////////////////// +/// \brief Create an image from a file in memory +/// +/// The supported image formats are bmp, png, tga, jpg, gif, +/// psd, hdr and pic. Some format options are not supported, +/// like progressive jpeg. +/// If this function fails, the image is left unchanged. +/// +/// \param data Pointer to the file data in memory +/// \param size Size of the data to load, in bytes +/// +/// \return A new sfImage object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_createFromMemory(const void* data, size_t size); + +//////////////////////////////////////////////////////////// +/// \brief Create an image from a custom stream +/// +/// The supported image formats are bmp, png, tga, jpg, gif, +/// psd, hdr and pic. Some format options are not supported, +/// like progressive jpeg. +/// If this function fails, the image is left unchanged. +/// +/// \param stream Source stream to read from +/// +/// \return A new sfImage object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_createFromStream(sfInputStream* stream); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing image +/// +/// \param image Image to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfImage_copy(const sfImage* image); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing image +/// +/// \param image Image to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfImage_destroy(sfImage* image); + +//////////////////////////////////////////////////////////// +/// \brief Save an image to a file on disk +/// +/// The format of the image is automatically deduced from +/// the extension. The supported image formats are bmp, png, +/// tga and jpg. The destination file is overwritten +/// if it already exists. This function fails if the image is empty. +/// +/// \param image Image object +/// \param filename Path of the file to save +/// +/// \return sfTrue if saving was successful +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfImage_saveToFile(const sfImage* image, const char* filename); + +//////////////////////////////////////////////////////////// +/// \brief Return the size of an image +/// +/// \param image Image object +/// +/// \return Size in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2u sfImage_getSize(const sfImage* image); + +//////////////////////////////////////////////////////////// +/// \brief Create a transparency mask from a specified color-key +/// +/// This function sets the alpha value of every pixel matching +/// the given color to \a alpha (0 by default), so that they +/// become transparent. +/// +/// \param image Image object +/// \param color Color to make transparent +/// \param alpha Alpha value to assign to transparent pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor color, sfUint8 alpha); + +//////////////////////////////////////////////////////////// +/// \brief Copy pixels from an image onto another +/// +/// This function does a slow pixel copy and should not be +/// used intensively. It can be used to prepare a complex +/// static image from several others, but if you need this +/// kind of feature in real-time you'd better use sfRenderTexture. +/// +/// If \a sourceRect is empty, the whole image is copied. +/// If \a applyAlpha is set to true, the transparency of +/// source pixels is applied. If it is false, the pixels are +/// copied unchanged with their alpha value. +/// +/// \param image Image object +/// \param source Source image to copy +/// \param destX X coordinate of the destination position +/// \param destY Y coordinate of the destination position +/// \param sourceRect Sub-rectangle of the source image to copy +/// \param 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); + +//////////////////////////////////////////////////////////// +/// \brief Change the color of a pixel in an image +/// +/// This function doesn't check the validity of the pixel +/// coordinates, using out-of-range values will result in +/// an undefined behaviour. +/// +/// \param image Image object +/// \param x X coordinate of pixel to change +/// \param y Y coordinate of pixel to change +/// \param color New color of the pixel +/// +//////////////////////////////////////////////////////////// +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 +/// +/// This function doesn't check the validity of the pixel +/// coordinates, using out-of-range values will result in +/// an undefined behaviour. +/// +/// \param image Image object +/// \param x X coordinate of pixel to get +/// \param y Y coordinate of pixel to get +/// +/// \return Color of the pixel at coordinates (x, 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. +/// 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. +/// +/// \param image Image object +/// +/// \return Read-only pointer to the array of pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfUint8* sfImage_getPixelsPtr(const sfImage* image); + +//////////////////////////////////////////////////////////// +/// \brief Flip an image horizontally (left <-> right) +/// +/// \param image Image object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfImage_flipHorizontally(sfImage* image); + +//////////////////////////////////////////////////////////// +/// \brief Flip an image vertically (top <-> bottom) +/// +/// \param image Image object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfImage_flipVertically(sfImage* image); + + +#endif // SFML_IMAGE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/PrimitiveType.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/PrimitiveType.h new file mode 100755 index 0000000..2f25ff4 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/PrimitiveType.h @@ -0,0 +1,54 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_PRIMITIVETYPE_H +#define SFML_PRIMITIVETYPE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Types of primitives that a sf::VertexArray can render +/// +/// Points and lines have no area, therefore their thickness +/// will always be 1 pixel, regardless the current transform +/// and view. +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfPoints, ///< List of individual points + sfLines, ///< List of individual lines + sfLinesStrip, ///< List of connected lines, a point uses the previous point to form a line + sfTriangles, ///< List of individual triangles + sfTrianglesStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle + sfTrianglesFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle + sfQuads ///< List of individual quads +} sfPrimitiveType; + + +#endif // SFML_BLENDMODE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Rect.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Rect.h new file mode 100755 index 0000000..eeef038 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Rect.h @@ -0,0 +1,81 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_RECT_H +#define SFML_RECT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> + + +//////////////////////////////////////////////////////////// +/// sfFloatRect and sfIntRect are utility classes for +/// manipulating rectangles. +//////////////////////////////////////////////////////////// +typedef struct +{ + float left; + float top; + float width; + float height; +} sfFloatRect; + +typedef struct +{ + int left; + int top; + int width; + int height; +} sfIntRect; + +//////////////////////////////////////////////////////////// +/// \brief Check if a point is inside a rectangle's area +/// +/// \param rect Rectangle to test +/// \param x X coordinate of the point to test +/// \param y Y coordinate of the point to test +/// +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Check intersection between two rectangles +/// +/// \param rect1 First rectangle to test +/// \param rect2 Second rectangle to test +/// \param intersection Rectangle to be filled with overlapping rect (can be NULL) +/// +/// \return sfTrue if rectangles overlap +/// +//////////////////////////////////////////////////////////// +CSFML_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/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RectangleShape.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RectangleShape.h new file mode 100755 index 0000000..936399b --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RectangleShape.h @@ -0,0 +1,422 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_RECTANGLESHAPE_H +#define SFML_RECTANGLESHAPE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new rectangle shape +/// +/// \return A new sfRectangleShape object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing rectangle shape +/// +/// \param shape Shape to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing rectangle shape +/// +/// \param Shape Shape to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Set the position of a rectangle shape +/// +/// This function completely overwrites the previous position. +/// See sfRectangleShape_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 sfRectangleShape_setPosition(sfRectangleShape* shape, sfVector2f position); + +//////////////////////////////////////////////////////////// +/// \brief Set the orientation of a rectangle shape +/// +/// This function completely overwrites the previous rotation. +/// See sfRectangleShape_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 sfRectangleShape_setRotation(sfRectangleShape* shape, float angle); + +//////////////////////////////////////////////////////////// +/// \brief Set the scale factors of a rectangle shape +/// +/// This function completely overwrites the previous scale. +/// See sfRectangleShape_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 sfRectangleShape_setScale(sfRectangleShape* shape, sfVector2f scale); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a rectangle shape +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 circle Shape object is (0, 0). +/// +/// \param shape Shape object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_setOrigin(sfRectangleShape* shape, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPosition(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a rectangle shape +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param shape Shape object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfRectangleShape_getRotation(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getScale(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getOrigin(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Move a rectangle shape by a given offset +/// +/// This function adds to the current position of the object, +/// unlike sfRectangleShape_setPosition which overwrites it. +/// +/// \param shape Shape object +/// \param offset Offset +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_move(sfRectangleShape* shape, sfVector2f offset); + +//////////////////////////////////////////////////////////// +/// \brief Rotate a rectangle shape +/// +/// This function adds to the current rotation of the object, +/// unlike sfRectangleShape_setRotation which overwrites it. +/// +/// \param shape Shape object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_rotate(sfRectangleShape* shape, float angle); + +//////////////////////////////////////////////////////////// +/// \brief Scale a rectangle shape +/// +/// This function multiplies the current scale of the object, +/// unlike sfRectangleShape_setScale which overwrites it. +/// +/// \param shape Shape object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_scale(sfRectangleShape* shape, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a rectangle shape +/// +/// \param shape shape object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfRectangleShape_getTransform(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a rectangle shape +/// +/// \param shape shape object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfRectangleShape_getInverseTransform(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Change the source texture of a rectangle shape +/// +/// The \a texture argument refers to a texture that must +/// exist as long as the shape uses it. Indeed, the shape +/// doesn't store its own copy of the texture, but rather keeps +/// a pointer to the one that you passed to this function. +/// If the source texture is destroyed and the shape tries to +/// use it, the behaviour is undefined. +/// \a texture can be NULL to disable texturing. +/// If \a resetRect is true, the TextureRect property of +/// the shape is automatically adjusted to the size of the new +/// texture. If it is false, the texture rect is left unchanged. +/// +/// \param shape Shape object +/// \param texture New texture +/// \param resetRect Should the texture rect be reset to the size of the new texture? +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect); + +//////////////////////////////////////////////////////////// +/// \brief Set the sub-rectangle of the texture that a rectangle shape will display +/// +/// The texture rect is useful when you don't want to display +/// the whole texture, but rather a part of it. +/// By default, the texture rect covers the entire texture. +/// +/// \param shape Shape object +/// \param rect Rectangle defining the region of the texture to display +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_setTextureRect(sfRectangleShape* shape, sfIntRect rect); + +//////////////////////////////////////////////////////////// +/// \brief Set the fill color of a rectangle 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 sfTransparent to make the inside of +/// the shape transparent, and have the outline alone. +/// By default, the shape's fill color is opaque white. +/// +/// \param shape Shape object +/// \param color New color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_setFillColor(sfRectangleShape* shape, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Set the outline color of a rectangle shape +/// +/// 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 sfRectangleShape_setOutlineColor(sfRectangleShape* shape, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Set the thickness of a rectangle shape's outline +/// +/// This number cannot be negative. Using zero disables +/// the outline. +/// By default, the outline thickness is 0. +/// +/// \param shape Shape object +/// \param thickness New outline thickness +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_setOutlineThickness(sfRectangleShape* shape, float thickness); + +//////////////////////////////////////////////////////////// +/// \brief Get the source texture of a rectangle shape +/// +/// If the shape has no source texture, a NULL pointer is returned. +/// The returned pointer is const, which means that you can't +/// modify the texture when you retrieve it with this function. +/// +/// \param shape Shape object +/// +/// \return Pointer to the shape's texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfRectangleShape_getTexture(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the sub-rectangle of the texture displayed by a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Texture rectangle of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfRectangleShape_getTextureRect(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the fill color of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Fill color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfRectangleShape_getFillColor(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline color of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Outline color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfRectangleShape_getOutlineColor(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline thickness of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Outline thickness of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the total number of points of a rectangle shape +/// +/// \param shape Shape object +/// +/// \return Number of points of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get a point of a rectangle 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] +/// +/// \return Index-th point of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index); + +//////////////////////////////////////////////////////////// +/// \brief Set the size of a rectangle shape +/// +/// \param shape Shape object +/// \param size New size of the rectangle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of a rectangle shape +/// +/// \param shape Shape object +// +/// \return height Size of the rectangle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getSize(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the local bounding rectangle of a rectangle shape +/// +/// The returned rectangle is in local coordinates, which means +/// that it ignores the transformations (translation, rotation, +/// scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// entity in the entity's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Local bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getLocalBounds(const sfRectangleShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the global bounding rectangle of a rectangle shape +/// +/// The returned rectangle is in global coordinates, which means +/// that it takes in account the transformations (translation, +/// rotation, scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// sprite in the global 2D world's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Global bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getGlobalBounds(const sfRectangleShape* shape); + + +#endif // SFML_RECTANGLESHAPE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderStates.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderStates.h new file mode 100755 index 0000000..86c2258 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderStates.h @@ -0,0 +1,50 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_RENDERSTATES_H +#define SFML_RENDERSTATES_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/BlendMode.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Define the states used for drawing to a RenderTarget +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfBlendMode blendMode; ///< Blending mode + sfTransform transform; ///< Transform + const sfTexture* texture; ///< Texture + const sfShader* shader; ///< Shader +} sfRenderStates; + + +#endif // SFML_RENDERSTATES_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderTexture.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderTexture.h new file mode 100755 index 0000000..959f4d5 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderTexture.h @@ -0,0 +1,318 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_RENDERTEXTURE_H +#define SFML_RENDERTEXTURE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/Graphics/PrimitiveType.h> +#include <SFML/Graphics/RenderStates.h> +#include <SFML/Graphics/Vertex.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Construct a new render texture +/// +/// \param width Width of the render texture +/// \param height Height of the render texture +/// \param depthBuffer Do you want a depth-buffer attached? (useful only if you're doing 3D OpenGL on the rendertexture) +/// +/// \return A new sfRenderTexture object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing render texture +/// +/// \param renderTexture Render texture to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_destroy(sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of the rendering region of a render texture +/// +/// \param renderTexture Render texture object +/// +/// \return Size in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Activate or deactivate a render texture as the current target for rendering +/// +/// \param renderTexture Render texture object +/// \param active sfTrue to activate, sfFalse to deactivate +/// +/// \return True if operation was successful, false otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active); + +//////////////////////////////////////////////////////////// +/// \brief Update the contents of the target texture +/// +/// \param renderTexture Render texture object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_display(sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Clear the rendertexture with the given color +/// +/// \param renderTexture Render texture object +/// \param color Fill color +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Change the current active view of a render texture +/// +/// \param renderTexture Render texture object +/// \param view Pointer to the new view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Get the current active view of a render texture +/// +/// \param renderTexture Render texture object +/// +/// \return Current active view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Get the default view of a render texture +/// +/// \param renderTexture Render texture object +/// +/// \return Default view of the rendertexture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Get the viewport of a view applied to this target +/// +/// \param renderTexture Render texture object +/// \param view Target view +/// +/// \return Viewport rectangle, expressed in pixels in the current target +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Convert a point from texture coordinates to world coordinates +/// +/// This function finds the 2D position that matches the +/// given pixel of the render-texture. In other words, it does +/// the inverse of what the graphics card does, to find the +/// initial position of a rendered pixel. +/// +/// Initially, both coordinate systems (world units and target pixels) +/// match perfectly. But if you define a custom view or resize your +/// render-texture, this assertion is not true anymore, ie. a point +/// located at (10, 50) in your render-texture may map to the point +/// (150, 75) in your 2D world -- if the view is translated by (140, 25). +/// +/// This version uses a custom view for calculations, see the other +/// overload of the function if you want to use the current view of the +/// render-texture. +/// +/// \param renderTexture Render texture object +/// \param point Pixel to convert +/// \param view The view to use for converting the point +/// +/// \return The converted point, in "world" units +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Convert a point from world coordinates to texture coordinates +/// +/// This function finds the pixel of the render-texture that matches +/// the given 2D point. In other words, it goes through the same process +/// as the graphics card, to compute the final position of a rendered point. +/// +/// Initially, both coordinate systems (world units and target pixels) +/// match perfectly. But if you define a custom view or resize your +/// render-texture, this assertion is not true anymore, ie. a point +/// located at (150, 75) in your 2D world may map to the pixel +/// (10, 50) of your render-texture -- if the view is translated by (140, 25). +/// +/// This version uses a custom view for calculations, see the other +/// overload of the function if you want to use the current view of the +/// render-texture. +/// +/// \param renderTexture Render texture object +/// \param point Point to convert +/// \param view The view to use for converting the point +/// +/// \return The converted point, in target coordinates (pixels) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Draw a drawable object to the render-target +/// +/// \param renderTexture Render texture object +/// \param object Object to draw +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Draw primitives defined by an array of vertices to a render texture +/// +/// \param renderTexture Render texture object +/// \param vertices Pointer to the vertices +/// \param vertexCount Number of vertices in the array +/// \param type Type of primitives to draw +/// \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); + +//////////////////////////////////////////////////////////// +/// \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, +/// 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 +/// +/// Note that this function is quite expensive: it saves all the +/// possible OpenGL states and matrices, even the ones you +/// don't care about. Therefore it should be used wisely. +/// 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 +/// function if you do so. +/// +/// \param renderTexture Render texture object +/// +//////////////////////////////////////////////////////////// +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 +/// description of these functions. +/// +/// \param renderTexture Render texture object +/// +//////////////////////////////////////////////////////////// +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*() +/// calls will work as expected. +/// +/// \param renderTexture Render texture object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Get the target texture of a render texture +/// +/// \param renderTexture Render texture object +/// +/// \return Pointer to the target texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable the smooth filter on a render texture +/// +/// \param renderTexture Render texture object +/// \param smooth sfTrue to enable smoothing, sfFalse to disable it +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether the smooth filter is enabled or not for a render texture +/// +/// \param renderTexture Render texture object +/// +/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable texture repeating +/// +/// \param renderTexture Render texture object +/// \param repeated sfTrue to enable repeating, sfFalse to disable it +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether the texture is repeated or not +/// +/// \param renderTexture Render texture object +/// +/// \return sfTrue if repeat mode is enabled, sfFalse if it is disabled +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture); + +#endif // SFML_RENDERTEXTURE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderWindow.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderWindow.h new file mode 100755 index 0000000..584ca02 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/RenderWindow.h @@ -0,0 +1,513 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_RENDERWINDOW_H +#define SFML_RENDERWINDOW_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/Graphics/PrimitiveType.h> +#include <SFML/Graphics/RenderStates.h> +#include <SFML/Graphics/Vertex.h> +#include <SFML/Window/Event.h> +#include <SFML/Window/VideoMode.h> +#include <SFML/Window/WindowHandle.h> +#include <SFML/Window/Window.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Construct a new render window +/// +/// \param mode Video mode to use +/// \param title Title of the window +/// \param style Window style +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Construct a new render window (with a UTF-32 title) +/// +/// \param mode Video mode to use +/// \param title Title of the window (UTF-32) +/// \param style Window style +/// \param settings Creation settings (pass NULL to use default values) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings); + +//////////////////////////////////////////////////////////// +/// \brief Construct a render window from an existing control +/// +/// \param handle Platform-specific handle of the control +/// \param settings Creation settings (pass NULL to use default values) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing render window +/// +/// \param renderWindow Render window to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Close a render window (but doesn't destroy the internal data) +/// +/// \param renderWindow Render window to close +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not a render window is opened +/// +/// \param renderWindow Render window object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Get the creation settings of a render window +/// +/// \param renderWindow Render window object +/// +/// \return Settings used to create the window +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Get the event on top of event queue of a render window, if any, and pop it +/// +/// \param renderWindow Render window object +/// \param event Event to fill, if any +/// +/// \return sfTrue if an event was returned, sfFalse if event queue was empty +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event); + +//////////////////////////////////////////////////////////// +/// \brief Wait for an event and return it +/// +/// \param renderWindow Render window object +/// \param event Event to fill +/// +/// \return sfFalse if an error occured +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a render window +/// +/// \param renderWindow Render window object +/// +/// \return Position in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Change the position of a render window on screen +/// +/// Only works for top-level windows +/// +/// \param renderWindow Render window object +/// \param position New position, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of the rendering region of a render window +/// +/// \param renderWindow Render window object +/// +/// \return Size in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Change the size of the rendering region of a render window +/// +/// \param renderWindow Render window object +/// \param size New size, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size); + +//////////////////////////////////////////////////////////// +/// \brief Change the title of a render window +/// +/// \param renderWindow Render window object +/// \param title New title +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title); + +//////////////////////////////////////////////////////////// +/// \brief Change the title of a render window (with a UTF-32 string) +/// +/// \param renderWindow Render window object +/// \param title New title +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title); + +//////////////////////////////////////////////////////////// +/// \brief Change a render window's icon +/// +/// \param renderWindow Render window object +/// \param width Icon's width, in pixels +/// \param height Icon's height, in pixels +/// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels); + +//////////////////////////////////////////////////////////// +/// \brief Show or hide a render window +/// +/// \param renderWindow Render window object +/// \param visible sfTrue to show the window, sfFalse to hide it +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible); + +//////////////////////////////////////////////////////////// +/// \brief Show or hide the mouse cursor on a render window +/// +/// \param renderWindow Render window object +/// \param show sfTrue to show, sfFalse to hide +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show); + +//////////////////////////////////////////////////////////// +/// \brief Enable / disable vertical synchronization on a render window +/// +/// \param renderWindow Render window object +/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable automatic key-repeat for keydown events +/// +/// Automatic key-repeat is enabled by default +/// +/// \param renderWindow Render window object +/// \param enabled sfTrue to enable, sfFalse to disable +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled); + +//////////////////////////////////////////////////////////// +/// \brief Activate or deactivate a render window as the current target for rendering +/// +/// \param renderWindow Render window object +/// \param active sfTrue to activate, sfFalse to deactivate +/// +/// \return True if operation was successful, false otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active); + +//////////////////////////////////////////////////////////// +/// \brief Display a render window on screen +/// +/// \param renderWindow Render window object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Limit the framerate to a maximum fixed frequency for a render window +/// +/// \param renderWindow Render window object +/// \param limit Framerate limit, in frames per seconds (use 0 to disable 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 +/// +/// \param renderWindow Render window object +/// \param threshold New threshold, in range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold); + +//////////////////////////////////////////////////////////// +/// \brief Retrieve the OS-specific handle of a render window +/// +/// \param renderWindow Render window object +/// +/// \return Window handle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Clear a render window with the given color +/// +/// \param renderWindow Render window object +/// \param color Fill color +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Change the current active view of a render window +/// +/// \param renderWindow Render window object +/// \param view Pointer to the new view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Get the current active view of a render window +/// +/// \param renderWindow Render window object +/// +/// \return Current active view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Get the default view of a render window +/// +/// \param renderWindow Render window object +/// +/// \return Default view of the render window +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Get the viewport of a view applied to this target +/// +/// \param renderWindow Render window object +/// \param view Target view +/// +/// \return Viewport rectangle, expressed in pixels in the current target +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Convert a point from window coordinates to world coordinates +/// +/// This function finds the 2D position that matches the +/// given pixel of the render-window. In other words, it does +/// the inverse of what the graphics card does, to find the +/// initial position of a rendered pixel. +/// +/// Initially, both coordinate systems (world units and target pixels) +/// match perfectly. But if you define a custom view or resize your +/// render-window, this assertion is not true anymore, ie. a point +/// located at (10, 50) in your render-window may map to the point +/// (150, 75) in your 2D world -- if the view is translated by (140, 25). +/// +/// This function is typically used to find which point (or object) is +/// located below the mouse cursor. +/// +/// This version uses a custom view for calculations, see the other +/// overload of the function if you want to use the current view of the +/// render-window. +/// +/// \param renderWindow Render window object +/// \param point Pixel to convert +/// \param view The view to use for converting the point +/// +/// \return The converted point, in "world" units +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Convert a point from world coordinates to window coordinates +/// +/// This function finds the pixel of the render-window that matches +/// the given 2D point. In other words, it goes through the same process +/// as the graphics card, to compute the final position of a rendered point. +/// +/// Initially, both coordinate systems (world units and target pixels) +/// match perfectly. But if you define a custom view or resize your +/// render-window, this assertion is not true anymore, ie. a point +/// located at (150, 75) in your 2D world may map to the pixel +/// (10, 50) of your render-window -- if the view is translated by (140, 25). +/// +/// This version uses a custom view for calculations, see the other +/// overload of the function if you want to use the current view of the +/// render-window. +/// +/// \param renderWindow Render window object +/// \param point Point to convert +/// \param view The view to use for converting the point +/// +/// \return The converted point, in target coordinates (pixels) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Draw a drawable object to the render-target +/// +/// \param renderWindow render window object +/// \param object Object to draw +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Draw primitives defined by an array of vertices to a render window +/// +/// \param renderWindow render window object +/// \param vertices Pointer to the vertices +/// \param vertexCount Number of vertices in the array +/// \param type Type of primitives to draw +/// \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); + +//////////////////////////////////////////////////////////// +/// \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, +/// 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 +/// +/// Note that this function is quite expensive: it saves all the +/// possible OpenGL states and matrices, even the ones you +/// don't care about. Therefore it should be used wisely. +/// 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 +/// function if you do so. +/// +/// \param renderWindow render window object +/// +//////////////////////////////////////////////////////////// +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 +/// description of these functions. +/// +/// \param renderWindow render window object +/// +//////////////////////////////////////////////////////////// +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*() +/// calls will work as expected. +/// +/// \param renderWindow render window object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Copy the current contents of a render window to an image +/// +/// This is a slow operation, whose main purpose is to make +/// 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. +/// You can also draw things directly to a texture with the +/// sfRenderWindow class. +/// +/// \param renderWindow Render window object +/// +/// \return New image containing the captured contents +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow); + +//////////////////////////////////////////////////////////// +/// \brief Get the current position of the mouse relatively to a render-window +/// +/// This function returns the current position of the mouse +/// cursor relative to the given render-window, or desktop if NULL is passed. +/// +/// \param relativeTo Reference window +/// +/// \return Position of the mouse cursor, relative to the given render-window +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo); + +//////////////////////////////////////////////////////////// +/// \brief Set the current position of the mouse relatively to a render-window +/// +/// This function sets the current position of the mouse +/// cursor relative to the given render-window, or desktop if NULL is passed. +/// +/// \param position New position of the mouse +/// \param relativeTo Reference window +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow* relativeTo); + + +#endif // SFML_RENDERWINDOW_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Shader.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Shader.h new file mode 100755 index 0000000..a2c86f0 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Shader.h @@ -0,0 +1,388 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SHADER_H +#define SFML_SHADER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/InputStream.h> +#include <SFML/System/Vector2.h> +#include <SFML/System/Vector3.h> + + +//////////////////////////////////////////////////////////// +/// \brief Load both the vertex and fragment shaders from files +/// +/// This function can load both the vertex and the fragment +/// shaders, or only one of them: pass NULL if you don't want to load +/// either the vertex shader or the fragment shader. +/// The sources must be text files containing valid shaders +/// in GLSL language. GLSL is a C-like language dedicated to +/// OpenGL shaders; you'll probably need to read a good documentation +/// for it before writing your own shaders. +/// +/// \param vertexShaderFilename Path of the vertex shader file to load, or NULL to skip this shader +/// \param fragmentShaderFilename Path of the fragment shader file to load, or NULL to skip this shader +/// +/// \return A new sfShader object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +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 +/// +/// This function can load both the vertex and the fragment +/// shaders, or only one of them: pass NULL if you don't want to load +/// either the vertex shader or the fragment shader. +/// The sources must be valid shaders in GLSL language. GLSL is +/// a C-like language dedicated to OpenGL shaders; you'll +/// probably need to read a good documentation for it before +/// writing your own shaders. +/// +/// \param vertexShader String containing the source code of the vertex shader, or NULL to skip this shader +/// \param fragmentShader String containing the source code of the fragment shader, or NULL to skip this shader +/// +/// \return A new sfShader object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader); + +//////////////////////////////////////////////////////////// +/// \brief Load both the vertex and fragment shaders from custom streams +/// +/// This function can load both the vertex and the fragment +/// shaders, or only one of them: pass NULL if you don't want to load +/// either the vertex shader or the fragment shader. +/// The source codes must be valid shaders in GLSL language. +/// GLSL is a C-like language dedicated to OpenGL shaders; +/// you'll probably need to read a good documentation for +/// it before writing your own shaders. +/// +/// \param vertexShaderStream Source stream to read the vertex shader from, or NULL to skip this shader +/// \param fragmentShaderStream Source stream to read the fragment shader from, or NULL to skip this shader +/// +/// \return A new sfShader object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing shader +/// +/// \param shader Shader to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader); + +//////////////////////////////////////////////////////////// +/// \brief Change a float 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 float +/// (float GLSL type). +/// +/// Example: +/// \code +/// uniform float myparam; // this is the variable in the shader +/// \endcode +/// \code +/// sfShader_setFloatParameter(shader, "myparam", 5.2f); +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the parameter in the shader +/// \param x Value to assign +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char* name, float x); + +//////////////////////////////////////////////////////////// +/// \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 +/// sfShader_setFloat2Parameter(shader, "myparam", 5.2f, 6.0f); +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the parameter in the shader +/// \param x First component of the value to assign +/// \param y Second component of the value to assign +/// +//////////////////////////////////////////////////////////// +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 +/// +/// \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 +/// sfShader_setFloat3Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f); +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the parameter in the shader +/// \param x First component of the value to assign +/// \param y Second component of the value to assign +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Change a 4-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 4x1 vector +/// (vec4 GLSL type). +/// +/// Example: +/// \code +/// uniform vec4 myparam; // this is the variable in the shader +/// \endcode +/// \code +/// sfShader_setFloat4Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f, 0.4f); +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the parameter in the shader +/// \param x First component of the value to assign +/// \param y Second component of the value to assign +/// \param z Third component of the value to assign +/// \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); + +//////////////////////////////////////////////////////////// +/// \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 +/// +/// \a name is the name of the variable to change in the shader. +/// The corresponding parameter in the shader must be a 4x1 vector +/// (vec4 GLSL type). +/// +/// It is important to note that the components of the color are +/// normalized before being passed to the shader. Therefore, +/// they are converted from range [0 .. 255] to range [0 .. 1]. +/// For example, a sf::Color(255, 125, 0, 255) will be transformed +/// to a vec4(1.0, 0.5, 0.0, 1.0) in the shader. +/// +/// Example: +/// \code +/// uniform vec4 color; // this is the variable in the shader +/// \endcode +/// \code +/// sfShader_setColorParameter(shader, "color", sfColor_fromRGB(255, 128, 0)); +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the parameter in the shader +/// \param color Color to assign +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Change a matrix 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 4x4 matrix +/// (mat4 GLSL type). +/// +/// Example: +/// \code +/// uniform mat4 matrix; // this is the variable in the shader +/// \endcode +/// \code +/// @todo +/// sfShader_setTransformParameter(shader, "matrix", transform); +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the parameter in the shader +/// \param transform Transform to assign +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform); + +//////////////////////////////////////////////////////////// +/// \brief Change a texture 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 2D texture +/// (sampler2D GLSL type). +/// +/// Example: +/// \code +/// uniform sampler2D the_texture; // this is the variable in the shader +/// \endcode +/// \code +/// sf::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: +/// \code +/// sfShader_setCurrentTextureParameter(shader, "the_texture"). +/// \endcode +/// +/// \param shader Shader object +/// \param name Name of the texture in the shader +/// \param texture Texture to assign +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Change a texture parameter of a shader +/// +/// This function maps a shader texture variable to the +/// texture of the object being drawn, which cannot be +/// known in advance. +/// The corresponding parameter in the shader must be a 2D texture +/// (sampler2D GLSL type). +/// +/// Example: +/// \code +/// uniform sampler2D current; // this is the variable in the shader +/// \endcode +/// \code +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Bind a shader for rendering (activate it) +/// +/// This function is not part of the graphics API, it mustn't be +/// used when drawing SFML entities. It must be used only if you +/// mix sfShader with OpenGL code. +/// +/// \code +/// sfShader *s1, *s2; +/// ... +/// sfShader_bind(s1); +/// // draw OpenGL stuff that use s1... +/// sfShader_bind(s2); +/// // draw OpenGL stuff that use s2... +/// sfShader_bind(0); +/// // draw OpenGL stuff that use no shader... +/// \endcode +/// +/// \param shader Shader to bind, can be null to use no shader +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not the system supports shaders +/// +/// This function should always be called before using +/// the shader features. If it returns false, then +/// any attempt to use sfShader will fail. +/// +/// \return sfTrue if the system can use shaders, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void); + + +#endif // SFML_SHADER_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Shape.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Shape.h new file mode 100755 index 0000000..dc6254a --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Shape.h @@ -0,0 +1,412 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SHAPE_H +#define SFML_SHAPE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + +typedef unsigned int (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape +typedef sfVector2f (*sfShapeGetPointCallback)(unsigned int, void*); ///< Type of the callback used to get a point of a shape + +//////////////////////////////////////////////////////////// +/// \brief Create a new shape +/// +/// \param getPointCount Callback that provides the point count of the shape +/// \param getPoint Callback that provides the points of the shape +/// \param userData Data to pass to the callback functions +/// +/// \return A new sfShape object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount, + sfShapeGetPointCallback getPoint, + void* userData); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing shape +/// +/// \param Shape Shape to delete +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a shape +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 circle Shape object is (0, 0). +/// +/// \param shape Shape object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShape_setOrigin(sfShape* shape, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a shape +/// +/// \param shape Shape object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfShape_getPosition(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a shape +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param shape Shape object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfShape_getRotation(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a shape +/// +/// \param shape Shape object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfShape_getScale(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a shape +/// +/// \param shape Shape object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param shape Shape object +/// \param offset 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. +/// +/// \param shape Shape object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param shape Shape object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShape_scale(sfShape* shape, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a shape +/// +/// \param shape shape object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfShape_getTransform(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a shape +/// +/// \param shape shape object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfShape_getInverseTransform(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Change the source texture of a shape +/// +/// The \a texture argument refers to a texture that must +/// exist as long as the shape uses it. Indeed, the shape +/// doesn't store its own copy of the texture, but rather keeps +/// a pointer to the one that you passed to this function. +/// If the source texture is destroyed and the shape tries to +/// use it, the behaviour is undefined. +/// \a texture can be NULL to disable texturing. +/// If \a resetRect is true, the TextureRect property of +/// the shape is automatically adjusted to the size of the new +/// texture. If it is false, the texture rect is left unchanged. +/// +/// \param shape Shape object +/// \param texture New texture +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Set the sub-rectangle of the texture that a shape will display +/// +/// The texture rect is useful when you don't want to display +/// the whole texture, but rather a part of it. +/// By default, the texture rect covers the entire texture. +/// +/// \param shape Shape object +/// \param rect Rectangle defining the region of the texture to display +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShape_setTextureRect(sfShape* shape, sfIntRect rect); + +//////////////////////////////////////////////////////////// +/// \brief Set the fill color of a 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 sfTransparent to make the inside of +/// the shape transparent, and have the outline alone. +/// By default, the shape's fill color is opaque white. +/// +/// \param shape Shape object +/// \param color New color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShape_setFillColor(sfShape* shape, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Set the outline color of a shape +/// +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the thickness of a shape's outline +/// +/// This number cannot be negative. Using zero disables +/// the outline. +/// By default, the outline thickness is 0. +/// +/// \param shape Shape object +/// \param thickness New outline thickness +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShape_setOutlineThickness(sfShape* shape, float thickness); + +//////////////////////////////////////////////////////////// +/// \brief Get the source texture of a shape +/// +/// If the shape has no source texture, a NULL pointer is returned. +/// The returned pointer is const, which means that you can't +/// modify the texture when you retrieve it with this function. +/// +/// \param shape Shape object +/// +/// \return Pointer to the shape's texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfShape_getTexture(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the sub-rectangle of the texture displayed by a shape +/// +/// \param shape Shape object +/// +/// \return Texture rectangle of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfShape_getTextureRect(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the fill color of a shape +/// +/// \param shape Shape object +/// +/// \return Fill color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfShape_getFillColor(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline color of a shape +/// +/// \param shape Shape object +/// +/// \return Outline color of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfShape_getOutlineColor(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the outline thickness of a shape +/// +/// \param shape Shape object +/// +/// \return Outline thickness of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfShape_getOutlineThickness(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the total number of points of a shape +/// +/// \param shape Shape object +/// +/// \return Number of points of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get a point of a 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] +/// +/// \return Index-th point of the shape +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index); + +//////////////////////////////////////////////////////////// +/// \brief Get the local bounding rectangle of a shape +/// +/// The returned rectangle is in local coordinates, which means +/// that it ignores the transformations (translation, rotation, +/// scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// entity in the entity's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Local bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfShape_getLocalBounds(const sfShape* shape); + +//////////////////////////////////////////////////////////// +/// \brief Get the global bounding rectangle of a shape +/// +/// The returned rectangle is in global coordinates, which means +/// that it takes in account the transformations (translation, +/// rotation, scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// sprite in the global 2D world's coordinate system. +/// +/// \param shape Shape object +/// +/// \return Global bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +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). +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfShape_update(sfShape* shape); + + +#endif // SFML_SHAPE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Sprite.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Sprite.h new file mode 100755 index 0000000..40ebf37 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Sprite.h @@ -0,0 +1,333 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SPRITE_H +#define SFML_SPRITE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/BlendMode.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new sprite +/// +/// \return A new sfSprite object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfSprite* sfSprite_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing sprite +/// +/// \param sprite Sprite to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfSprite* sfSprite_copy(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing sprite +/// +/// \param sprite Sprite to delete +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a sprite +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 sprite Sprite object is (0, 0). +/// +/// \param sprite Sprite object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfSprite_setOrigin(sfSprite* sprite, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a sprite +/// +/// \param sprite Sprite object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfSprite_getPosition(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a sprite +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param sprite Sprite object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfSprite_getRotation(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a sprite +/// +/// \param sprite Sprite object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfSprite_getScale(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a sprite +/// +/// \param sprite Sprite object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param sprite Sprite object +/// \param offset 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. +/// +/// \param sprite Sprite object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param sprite Sprite object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfSprite_scale(sfSprite* sprite, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a sprite +/// +/// \param sprite Sprite object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfSprite_getTransform(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a sprite +/// +/// \param sprite Sprite object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfSprite_getInverseTransform(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Change the source texture of a sprite +/// +/// The \a texture argument refers to a texture that must +/// exist as long as the sprite uses it. Indeed, the sprite +/// doesn't store its own copy of the texture, but rather keeps +/// a pointer to the one that you passed to this function. +/// If the source texture is destroyed and the sprite tries to +/// use it, the behaviour is undefined. +/// If \a resetRect is true, the TextureRect property of +/// the sprite is automatically adjusted to the size of the new +/// texture. If it is false, the texture rect is left unchanged. +/// +/// \param sprite Sprite object +/// \param texture New texture +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Set the sub-rectangle of the texture that a sprite will display +/// +/// The texture rect is useful when you don't want to display +/// the whole texture, but rather a part of it. +/// By default, the texture rect covers the entire texture. +/// +/// \param sprite Sprite object +/// \param rectangle Rectangle defining the region of the texture to display +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfSprite_setTextureRect(sfSprite* sprite, sfIntRect rectangle); + +//////////////////////////////////////////////////////////// +/// \brief Set the global color of a sprite +/// +/// This color is modulated (multiplied) with the sprite's +/// texture. It can be used to colorize the sprite, or change +/// its global opacity. +/// By default, the sprite's color is opaque white. +/// +/// \param sprite Sprite object +/// \param color New color of the sprite +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfSprite_setColor(sfSprite* sprite, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Get the source texture of a sprite +/// +/// If the sprite has no source texture, a NULL pointer is returned. +/// The returned pointer is const, which means that you can't +/// modify the texture when you retrieve it with this function. +/// +/// \param sprite Sprite object +/// +/// \return Pointer to the sprite's texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTexture* sfSprite_getTexture(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the sub-rectangle of the texture displayed by a sprite +/// +/// \param sprite Sprite object +/// +/// \return Texture rectangle of the sprite +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfIntRect sfSprite_getTextureRect(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the global color of a sprite +/// +/// \param sprite Sprite object +/// +/// \return Global color of the sprite +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfSprite_getColor(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the local bounding rectangle of a sprite +/// +/// The returned rectangle is in local coordinates, which means +/// that it ignores the transformations (translation, rotation, +/// scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// entity in the entity's coordinate system. +/// +/// \param sprite Sprite object +/// +/// \return Local bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfSprite_getLocalBounds(const sfSprite* sprite); + +//////////////////////////////////////////////////////////// +/// \brief Get the global bounding rectangle of a sprite +/// +/// The returned rectangle is in global coordinates, which means +/// that it takes in account the transformations (translation, +/// rotation, scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// sprite in the global 2D world's coordinate system. +/// +/// \param sprite Sprite object +/// +/// \return Global bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfSprite_getGlobalBounds(const sfSprite* sprite); + + +#endif // SFML_SPRITE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Text.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Text.h new file mode 100755 index 0000000..bb1fdd6 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Text.h @@ -0,0 +1,417 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TEXT_H +#define SFML_TEXT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/System/Vector2.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// sfText styles +//////////////////////////////////////////////////////////// +typedef enum +{ + sfTextRegular = 0, ///< Regular characters, no style + sfTextBold = 1 << 0, ///< Characters are bold + sfTextItalic = 1 << 1, ///< Characters are in italic + sfTextUnderlined = 1 << 2 ///< Characters are underlined +} sfTextStyle; + + +//////////////////////////////////////////////////////////// +/// \brief Create a new text +/// +/// \return A new sfText object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfText* sfText_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing text +/// +/// \param text Text to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfText* sfText_copy(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing text +/// +/// \param text Text to delete +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a text +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 object is (0, 0). +/// +/// \param text Text object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setOrigin(sfText* text, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a text +/// +/// \param text Text object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfText_getPosition(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a text +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param text Text object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfText_getRotation(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a text +/// +/// \param text Text object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfText_getScale(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a text +/// +/// \param text Text object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param text Text object +/// \param offset 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. +/// +/// \param text Text object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param text Text object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_scale(sfText* text, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a text +/// +/// \param text Text object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfText_getTransform(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a text +/// +/// \param text Text object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfText_getInverseTransform(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Set the string of a text (from an ANSI string) +/// +/// A text's string is empty by default. +/// +/// \param text Text object +/// \param string New string +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setString(sfText* text, const char* string); + +//////////////////////////////////////////////////////////// +/// \brief Set the string of a text (from a unicode string) +/// +/// \param text Text object +/// \param string New string +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const sfUint32* string); + +//////////////////////////////////////////////////////////// +/// \brief Set the font of a text +/// +/// The \a font argument refers to a texture that must +/// exist as long as the text uses it. Indeed, the text +/// doesn't store its own copy of the font, but rather keeps +/// a pointer to the one that you passed to this function. +/// If the font is destroyed and the text tries to +/// use it, the behaviour is undefined. +/// +/// \param text Text object +/// \param font New font +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font); + +//////////////////////////////////////////////////////////// +/// \brief Set the character size of a text +/// +/// The default size is 30. +/// +/// \param text Text object +/// \param size New character size, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size); + +//////////////////////////////////////////////////////////// +/// \brief Set the style of a text +/// +/// You can pass a combination of one or more styles, for +/// example sfTextBold | sfTextItalic. +/// The default style is sfTextRegular. +/// +/// \param text Text object +/// \param style New style +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style); + +//////////////////////////////////////////////////////////// +/// \brief Set the global color of a text +/// +/// By default, the text's color is opaque white. +/// +/// \param text Text object +/// \param color New color of the text +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color); + +//////////////////////////////////////////////////////////// +/// \brief Get the string of a text (returns an ANSI string) +/// +/// \param text Text object +/// +/// \return String as a locale-dependant ANSI string +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the string of a text (returns a unicode string) +/// +/// \param text Text object +/// +/// \return String as UTF-32 +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the font used by a text +/// +/// If the text has no font attached, a NULL pointer is returned. +/// The returned pointer is const, which means that you can't +/// modify the font when you retrieve it with this function. +/// +/// \param text Text object +/// +/// \return Pointer to the font +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfFont* sfText_getFont(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of the characters of a text +/// +/// \param text Text object +/// +/// \return Size of the characters +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the style of a text +/// +/// \param text Text object +/// +/// \return Current string style (see sfTextStyle enum) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the global color of a text +/// +/// \param text Text object +/// +/// \return Global color of the text +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfColor sfText_getColor(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Return the position of the \a index-th character in a text +/// +/// This function computes the visual position of a character +/// from its index in the string. The returned position is +/// in global coordinates (translation, rotation, scale and +/// origin are applied). +/// If \a index is out of range, the position of the end of +/// the string is returned. +/// +/// \param text Text object +/// \param index Index of the character +/// +/// \return Position of the character +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfText_findCharacterPos(const sfText* text, size_t index); + +//////////////////////////////////////////////////////////// +/// \brief Get the local bounding rectangle of a text +/// +/// The returned rectangle is in local coordinates, which means +/// that it ignores the transformations (translation, rotation, +/// scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// entity in the entity's coordinate system. +/// +/// \param text Text object +/// +/// \return Local bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfText_getLocalBounds(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the global bounding rectangle of a text +/// +/// The returned rectangle is in global coordinates, which means +/// that it takes in account the transformations (translation, +/// rotation, scale, ...) that are applied to the entity. +/// In other words, this function returns the bounds of the +/// text in the global 2D world's coordinate system. +/// +/// \param text Text object +/// +/// \return Global bounding rectangle of the entity +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfText_getGlobalBounds(const sfText* text); + + +#endif // SFML_TEXT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Texture.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Texture.h new file mode 100755 index 0000000..0d4571d --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Texture.h @@ -0,0 +1,264 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TEXTURE_H +#define SFML_TEXTURE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/Window/Types.h> +#include <SFML/System/InputStream.h> +#include <SFML/System/Vector2.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new texture +/// +/// \param width Texture width +/// \param height Texture height +/// +/// \return A new sfTexture object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTexture* sfTexture_create(unsigned int width, unsigned int height); + +//////////////////////////////////////////////////////////// +/// \brief Create a new texture from a file +/// +/// \param filename Path of the image file to load +/// \param area Area of the source image to load (NULL to load the entire image) +/// +/// \return A new sfTexture object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area); + +//////////////////////////////////////////////////////////// +/// \brief Create a new texture from a file in memory +/// +/// \param data Pointer to the file data in memory +/// \param sizeInBytes Size of the data to load, in bytes +/// \param area Area of the source image to load (NULL to load the entire image) +/// +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Create a new texture from a custom stream +/// +/// \param stream Source stream to read from +/// \param area Area of the source image to load (NULL to load the entire image) +/// +/// \return A new sfTexture object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area); + +//////////////////////////////////////////////////////////// +/// \brief Create a new texture from an image +/// +/// \param image Image to upload to the texture +/// \param area Area of the source image to load (NULL to load the entire image) +/// +/// \return A new sfTexture object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing texture +/// +/// \param texture Texture to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing texture +/// +/// \param texture Texture to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Return the size of the texture +/// +/// \param texture Texture to read +/// +/// \return Size in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2u sfTexture_getSize(const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Copy a texture's pixels to an image +/// +/// \param texture Texture to copy +/// +/// \return Image containing the texture's pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Update a texture from an array of pixels +/// +/// \param texture Texture to update +/// \param pixels Array of pixels to copy to the texture +/// \param width Width of the pixel region contained in \a pixels +/// \param height Height of the pixel region contained in \a pixels +/// \param x X offset in the texture where to copy the source pixels +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Update a texture from an image +/// +/// \param texture Texture to update +/// \param image Image to copy to the texture +/// \param x X offset in the texture where to copy the source pixels +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Update a texture from the contents of a window +/// +/// \param texture Texture to update +/// \param window Window to copy to the texture +/// \param x X offset in the texture where to copy the source pixels +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Update a texture from the contents of a render-window +/// +/// \param texture Texture to update +/// \param renderWindow Render-window to copy to the texture +/// \param x X offset in the texture where to copy the source pixels +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable the smooth filter on a texture +/// +/// \param texture The texture object +/// \param smooth sfTrue to enable smoothing, sfFalse to disable it +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether the smooth filter is enabled or not for a texture +/// +/// \param texture The texture object +/// +/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable repeating for a texture +/// +/// Repeating is involved when using texture coordinates +/// outside the texture rectangle [0, 0, width, height]. +/// In this case, if repeat mode is enabled, the whole texture +/// will be repeated as many times as needed to reach the +/// coordinate (for example, if the X texture coordinate is +/// 3 * width, the texture will be repeated 3 times). +/// If repeat mode is disabled, the "extra space" will instead +/// be filled with border pixels. +/// Warning: on very old graphics cards, white pixels may appear +/// when the texture is repeated. With such cards, repeat mode +/// can be used reliably only if the texture has power-of-two +/// dimensions (such as 256x128). +/// Repeating is disabled by default. +/// +/// \param texture The texture object +/// \param repeated True to repeat the texture, false to disable repeating +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeated); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a texture is repeated or not +/// +/// \param texture The texture object +/// +/// \return sfTrue if repeat mode is enabled, sfFalse if it is disabled +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Bind a texture for rendering +/// +/// This function is not part of the graphics API, it mustn't be +/// used when drawing SFML entities. It must be used only if you +/// mix sfTexture with OpenGL code. +/// +/// \code +/// sfTexture *t1, *t2; +/// ... +/// sfTexture_bind(t1); +/// // draw OpenGL stuff that use t1... +/// sfTexture_bind(t2); +/// // draw OpenGL stuff that use t2... +/// sfTexture_bind(NULL); +/// // draw OpenGL stuff that use no texture... +/// \endcode +/// +/// \param texture Pointer to the texture to bind, can be null to use no texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture); + +//////////////////////////////////////////////////////////// +/// \brief Get the maximum texture size allowed +/// +/// \return Maximum size allowed for textures, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize(); + + +#endif // SFML_TEXTURE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Transform.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Transform.h new file mode 100755 index 0000000..0db94bb --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Transform.h @@ -0,0 +1,210 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TRANSFORM_H +#define SFML_TRANSFORM_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + + +//////////////////////////////////////////////////////////// +/// \brief Encapsulate a 3x3 transform matrix +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + float matrix[9]; +} sfTransform; + + +//////////////////////////////////////////////////////////// +/// \brief Identity transform (does nothing) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfTransform sfTransform_Identity; + +//////////////////////////////////////////////////////////// +/// \brief Create a new transform from a matrix +/// +/// \param a00 Element (0, 0) of the matrix +/// \param a01 Element (0, 1) of the matrix +/// \param a02 Element (0, 2) of the matrix +/// \param a10 Element (1, 0) of the matrix +/// \param a11 Element (1, 1) of the matrix +/// \param a12 Element (1, 2) of the matrix +/// \param a20 Element (2, 0) of the matrix +/// \param a21 Element (2, 1) of the matrix +/// \param a22 Element (2, 2) of the matrix +/// +/// \return A new sfTransform object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfTransform_fromMatrix(float a00, float a01, float a02, + float a10, float a11, float a12, + float a20, float a21, float a22); + +//////////////////////////////////////////////////////////// +/// \brief Return the 4x4 matrix of a transform +/// +/// This function fills an array of 16 floats with the transform +/// converted as a 4x4 matrix, which is directly compatible with +/// OpenGL functions. +/// +/// \code +/// sfTransform transform = ...; +/// float matrix[16]; +/// sfTransform_getMatrix(&transform, matrix) +/// glLoadMatrixf(matrix); +/// \endcode +/// +/// \param transform Transform object +/// \param matrix Pointer to the 16-element array to fill with the matrix +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransform_getMatrix(const sfTransform* transform, float* matrix); + +//////////////////////////////////////////////////////////// +/// \brief Return the inverse of a transform +/// +/// If the inverse cannot be computed, a new identity transform +/// is returned. +/// +/// \param transform Transform object +/// \return The inverse matrix +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfTransform_getInverse(const sfTransform* transform); + +//////////////////////////////////////////////////////////// +/// \brief Apply a transform to a 2D point +/// +/// \param transform Transform object +/// \param point Point to transform +/// +/// \return Transformed point +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfTransform_transformPoint(const sfTransform* transform, sfVector2f point); + +//////////////////////////////////////////////////////////// +/// \brief Apply a transform to a rectangle +/// +/// Since SFML doesn't provide support for oriented rectangles, +/// the result of this function is always an axis-aligned +/// rectangle. Which means that if the transform contains a +/// rotation, the bounding rectangle of the transformed rectangle +/// is returned. +/// +/// \param transform Transform object +/// \param rectangle Rectangle to transform +/// +/// \return Transformed rectangle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect(const sfTransform* transform, sfFloatRect rectangle); + +//////////////////////////////////////////////////////////// +/// \brief Combine two transforms +/// +/// The result is a transform that is equivalent to applying +/// \a transform followed by \a other. Mathematically, it is +/// equivalent to a matrix multiplication. +/// +/// \param transform Transform object +/// \param right Transform to combine to \a transform +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransform_combine(sfTransform* transform, const sfTransform* other); + +//////////////////////////////////////////////////////////// +/// \brief Combine a transform with a translation +/// +/// \param transform Transform object +/// \param x Offset to apply on X axis +/// \param y Offset to apply on Y axis +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransform_translate(sfTransform* transform, float x, float y); + +//////////////////////////////////////////////////////////// +/// \brief Combine the current transform with a rotation +/// +/// \param transform Transform object +/// \param angle Rotation angle, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransform_rotate(sfTransform* transform, float angle); + +//////////////////////////////////////////////////////////// +/// \brief Combine the current transform with a rotation +/// +/// 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)]. +/// +/// \param transform Transform object +/// \param angle Rotation angle, in degrees +/// \param centerX X coordinate of the center of rotation +/// \param centerY Y coordinate of the center of rotation +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransform_rotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY); + +//////////////////////////////////////////////////////////// +/// \brief Combine the current transform with a scaling +/// +/// \param transform Transform object +/// \param scaleX Scaling factor on the X axis +/// \param scaleY Scaling factor on the Y axis +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransform_scale(sfTransform* transform, float scaleX, float scaleY); + +//////////////////////////////////////////////////////////// +/// \brief Combine the current transform with a scaling +/// +/// 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)] +/// +/// \param transform Transform object +/// \param scaleX Scaling factor on X axis +/// \param scaleY Scaling factor on Y axis +/// \param centerX X coordinate of the center of scaling +/// \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); + + +#endif // SFML_TRANSFORM_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Transformable.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Transformable.h new file mode 100755 index 0000000..1b1ac6d --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Transformable.h @@ -0,0 +1,217 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TRANSFORMABLE_H +#define SFML_TRANSFORMABLE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Types.h> +#include <SFML/Graphics/Transform.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new transformable +/// +/// \return A new sfTransformable object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransformable* sfTransformable_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing transformable +/// +/// \param transformable Transformable to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy(const sfTransformable* transformable); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing transformable +/// +/// \param transformable Transformable to delete +/// +//////////////////////////////////////////////////////////// +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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \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. +/// 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); + +//////////////////////////////////////////////////////////// +/// \brief Set the local origin of a transformable +/// +/// The origin of an object defines the center point for +/// all transformations (position, scale, rotation). +/// 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 transformable Transformable object is (0, 0). +/// +/// \param transformable Transformable object +/// \param origin New origin +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransformable_setOrigin(sfTransformable* transformable, sfVector2f origin); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a transformable +/// +/// \param transformable Transformable object +/// +/// \return Current position +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfTransformable_getPosition(const sfTransformable* transformable); + +//////////////////////////////////////////////////////////// +/// \brief Get the orientation of a transformable +/// +/// The rotation is always in the range [0, 360]. +/// +/// \param transformable Transformable object +/// +/// \return Current rotation, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfTransformable_getRotation(const sfTransformable* transformable); + +//////////////////////////////////////////////////////////// +/// \brief Get the current scale of a transformable +/// +/// \param transformable Transformable object +/// +/// \return Current scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfTransformable_getScale(const sfTransformable* transformable); + +//////////////////////////////////////////////////////////// +/// \brief Get the local origin of a transformable +/// +/// \param transformable Transformable object +/// +/// \return Current origin +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param transformable Transformable object +/// \param offset 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. +/// +/// \param transformable Transformable object +/// \param angle Angle of rotation, in degrees +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param transformable Transformable object +/// \param factors Scale factors +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTransformable_scale(sfTransformable* transformable, sfVector2f factors); + +//////////////////////////////////////////////////////////// +/// \brief Get the combined transform of a transformable +/// +/// \param transformable Transformable object +/// +/// \return Transform combining the position/rotation/scale/origin of the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfTransformable_getTransform(const sfTransformable* transformable); + +//////////////////////////////////////////////////////////// +/// \brief Get the inverse of the combined transform of a transformable +/// +/// \param transformable Transformable object +/// +/// \return Inverse of the combined transformations applied to the object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfTransform sfTransformable_getInverseTransform(const sfTransformable* transformable); + + +#endif // SFML_TRANSFORMABLE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Types.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Types.h new file mode 100755 index 0000000..8b63f7a --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Types.h @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_GRAPHICS_TYPES_H +#define SFML_GRAPHICS_TYPES_H + + +typedef struct sfCircleShape sfCircleShape; +typedef struct sfConvexShape sfConvexShape; +typedef struct sfFont sfFont; +typedef struct sfImage sfImage; +typedef struct sfShader sfShader; +typedef struct sfRectangleShape sfRectangleShape; +typedef struct sfRenderTexture sfRenderTexture; +typedef struct sfRenderWindow sfRenderWindow; +typedef struct sfShape sfShape; +typedef struct sfSprite sfSprite; +typedef struct sfText sfText; +typedef struct sfTexture sfTexture; +typedef struct sfTransformable sfTransformable; +typedef struct sfVertexArray sfVertexArray; +typedef struct sfView sfView; + + +#endif // SFML_GRAPHICS_TYPES_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Vertex.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Vertex.h new file mode 100755 index 0000000..b2c0996 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/Vertex.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_VERTEX_H +#define SFML_VERTEX_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Color.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// Define a point with color and texture coordinates +//////////////////////////////////////////////////////////// +typedef struct +{ + 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; + + +#endif // SFML_VERTEX_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/VertexArray.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/VertexArray.h new file mode 100755 index 0000000..c050eed --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/VertexArray.h @@ -0,0 +1,167 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_VERTEXARRAY_H +#define SFML_VERTEXARRAY_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/PrimitiveType.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/Graphics/Vertex.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new vertex array +/// +/// \return A new sfVertexArray object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing vertex array +/// +/// \param vertexArray Vertex array to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy(const sfVertexArray* vertexArray); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing vertex array +/// +/// \param vertexArray Vertex array to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexArray_destroy(sfVertexArray* vertexArray); + +//////////////////////////////////////////////////////////// +/// \brief Return the vertex count of a vertex array +/// +/// \param vertexArray Vertex array object +/// +/// \return Number of vertices in the array +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray); + +//////////////////////////////////////////////////////////// +/// \brief Get access to a vertex by its index +/// +/// This function doesn't check \a index, it must be in range +/// [0, vertex count - 1]. The behaviour is undefined +/// otherwise. +/// +/// \param vertexArray Vertex array object +/// \param index Index of the vertex to get +/// +/// \return Pointer to the index-th vertex +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index); + +//////////////////////////////////////////////////////////// +/// \brief Clear a vertex array +/// +/// This function removes all the vertices from the array. +/// It doesn't deallocate the corresponding memory, so that +/// adding new vertices after clearing doesn't involve +/// reallocating all the memory. +/// +/// \param vertexArray Vertex array object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexArray_clear(sfVertexArray* vertexArray); + +//////////////////////////////////////////////////////////// +/// \brief Resize the vertex array +/// +/// If \a vertexCount is greater than the current size, the previous +/// vertices are kept and new (default-constructed) vertices are +/// added. +/// If \a vertexCount is less than the current size, existing vertices +/// are removed from the array. +/// +/// \param vertexArray Vertex array objet +/// \param vertexCount New size of the array (number of vertices) +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount); + +//////////////////////////////////////////////////////////// +/// \brief Add a vertex to a vertex array array +/// +/// \param vertexArray Vertex array objet +/// \param vertex Vertex to add +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexArray_append(sfVertexArray* vertexArray, sfVertex vertex); + +//////////////////////////////////////////////////////////// +/// \brief Set the type of primitives of a vertex array +/// +/// This function defines how the vertices must be interpreted +/// when it's time to draw them: +/// \li As points +/// \li As lines +/// \li As triangles +/// \li As quads +/// The default primitive type is sfPoints. +/// +/// \param vertexArray Vertex array objet +/// \param type Type of primitive +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type); + +//////////////////////////////////////////////////////////// +/// \brief Get the type of primitives drawn by a vertex array +/// +/// \param vertexArray Vertex array objet +/// +/// \return Primitive type +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray); + +//////////////////////////////////////////////////////////// +/// \brief Compute the bounding rectangle of a vertex array +/// +/// This function returns the axis-aligned rectangle that +/// contains all the vertices of the array. +/// +/// \param vertexArray Vertex array objet +/// +/// \return Bounding rectangle of the vertex array +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray); + + +#endif // SFML_VERTEXARRAY_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/View.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/View.h new file mode 100755 index 0000000..70acef5 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Graphics/View.h @@ -0,0 +1,206 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_VIEW_H +#define SFML_VIEW_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Graphics/Export.h> +#include <SFML/Graphics/Rect.h> +#include <SFML/Graphics/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a default view +/// +/// This function creates a default view of (0, 0, 1000, 1000) +/// +/// \return A new sfView object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfView* sfView_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Construct a view from a rectangle +/// +/// \param rectangle Rectangle defining the zone to display +/// +/// \return A new sfView object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfView* sfView_createFromRect(sfFloatRect rectangle); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing view +/// +/// \param view View to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfView* sfView_copy(const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing view +/// +/// \param view View to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_destroy(sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Set the center of a view +/// +/// \param view View object +/// \param center New center +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_setCenter(sfView* view, sfVector2f center); + +//////////////////////////////////////////////////////////// +/// \brief Set the size of a view +/// +/// \param view View object +/// \param size New size of the view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_setSize(sfView* view, sfVector2f size); + +//////////////////////////////////////////////////////////// +/// \brief Set the orientation of a view +/// +/// The default rotation of a view is 0 degree. +/// +/// \param view View object +/// \param angle New angle, in degrees +/// +//////////////////////////////////////////////////////////// +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 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. +/// +/// \param view View object +/// \param viewport New viewport rectangle +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_setViewport(sfView* view, sfFloatRect viewport); + +//////////////////////////////////////////////////////////// +/// \brief Reset a view to the given rectangle +/// +/// Note that this function resets the rotation angle to 0. +/// +/// \param view View object +/// \param rectangle Rectangle defining the zone to display +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_reset(sfView* view, sfFloatRect rectangle); + +//////////////////////////////////////////////////////////// +/// \brief Get the center of a view +/// +/// \param view View object +/// +/// \return Center of the view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfView_getCenter(const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of a view +/// +/// \param view View object +/// +/// \return Size of the view +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVector2f sfView_getSize(const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Get the current orientation of a view +/// +/// \param view View object +/// +/// \return Rotation angle of the view, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfView_getRotation(const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Get the target viewport rectangle of a view +/// +/// \param view View object +/// +/// \return Viewport rectangle, expressed as a factor of the target size +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfFloatRect sfView_getViewport(const sfView* view); + +//////////////////////////////////////////////////////////// +/// \brief Move a view relatively to its current position +/// +/// \param view View object +/// \param offset Offset +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_move(sfView* view, sfVector2f offset); + +//////////////////////////////////////////////////////////// +/// \brief Rotate a view relatively to its current orientation +/// +/// \param view View object +/// \param angle Angle to rotate, in degrees +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_rotate(sfView* view, float angle); + +//////////////////////////////////////////////////////////// +/// \brief Resize a view rectangle relatively to its current size +/// +/// Resizing the view simulates a zoom, as the zone displayed on +/// screen grows or shrinks. +/// \a factor is a multiplier: +/// \li 1 keeps the size unchanged +/// \li > 1 makes the view bigger (objects appear smaller) +/// \li < 1 makes the view smaller (objects appear bigger) +/// +/// \param view View object +/// \param factor Zoom factor to apply +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfView_zoom(sfView* view, float factor); + + +#endif // SFML_VIEW_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network.h new file mode 100755 index 0000000..b6c5fc7 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_NETWORK_H +#define SFML_NETWORK_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// + +#include <SFML/System.h> +#include <SFML/Network/Ftp.h> +#include <SFML/Network/Http.h> +#include <SFML/Network/IpAddress.h> +#include <SFML/Network/Packet.h> +#include <SFML/Network/SocketSelector.h> +#include <SFML/Network/TcpListener.h> +#include <SFML/Network/TcpSocket.h> +#include <SFML/Network/UdpSocket.h> + + +#endif // SFML_NETWORK_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Export.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Export.h new file mode 100755 index 0000000..f103e2d --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Export.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_NETWORK_EXPORT_H +#define SFML_NETWORK_EXPORT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Config.h> + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(CSFML_NETWORK_EXPORTS) + + #define CSFML_NETWORK_API CSFML_API_EXPORT + +#else + + #define CSFML_NETWORK_API CSFML_API_IMPORT + +#endif + + +#endif // SFML_NETWORK_EXPORT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Ftp.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Ftp.h new file mode 100755 index 0000000..0e33db1 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Ftp.h @@ -0,0 +1,510 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_FTP_H +#define SFML_FTP_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/IpAddress.h> +#include <SFML/Network/Types.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Enumeration of transfer modes +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfFtpBinary, ///< Binary mode (file is transfered as a sequence of bytes) + sfFtpAscii, ///< Text mode using ASCII encoding + sfFtpEbcdic ///< Text mode using EBCDIC encoding +} sfFtpTransferMode; + + +//////////////////////////////////////////////////////////// +/// \brief Status codes possibly returned by a FTP response +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + // 1xx: the requested action is being initiated, + // expect another reply before proceeding with a new command + sfFtpRestartMarkerReply = 110, ///< Restart marker reply + sfFtpServiceReadySoon = 120, ///< Service ready in N minutes + sfFtpDataConnectionAlreadyOpened = 125, ///< Data connection already opened, transfer starting + sfFtpOpeningDataConnection = 150, ///< File status ok, about to open data connection + + // 2xx: the requested action has been successfully completed + sfFtpOk = 200, ///< Command ok + sfFtpPointlessCommand = 202, ///< Command not implemented + sfFtpSystemStatus = 211, ///< System status, or system help reply + sfFtpDirectoryStatus = 212, ///< Directory status + sfFtpFileStatus = 213, ///< File status + sfFtpHelpMessage = 214, ///< Help message + sfFtpSystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document + sfFtpServiceReady = 220, ///< Service ready for new user + sfFtpClosingConnection = 221, ///< Service closing control connection + sfFtpDataConnectionOpened = 225, ///< Data connection open, no transfer in progress + sfFtpClosingDataConnection = 226, ///< Closing data connection, requested file action successful + sfFtpEnteringPassiveMode = 227, ///< Entering passive mode + sfFtpLoggedIn = 230, ///< User logged in, proceed. Logged out if appropriate + sfFtpFileActionOk = 250, ///< Requested file action ok + sfFtpDirectoryOk = 257, ///< PATHNAME created + + // 3xx: the command has been accepted, but the requested action + // is dormant, pending receipt of further information + sfFtpNeedPassword = 331, ///< User name ok, need password + sfFtpNeedAccountToLogIn = 332, ///< Need account for login + sfFtpNeedInformation = 350, ///< Requested file action pending further information + + // 4xx: the command was not accepted and the requested action did not take place, + // but the error condition is temporary and the action may be requested again + sfFtpServiceUnavailable = 421, ///< Service not available, closing control connection + sfFtpDataConnectionUnavailable = 425, ///< Can't open data connection + sfFtpTransferAborted = 426, ///< Connection closed, transfer aborted + sfFtpFileActionAborted = 450, ///< Requested file action not taken + sfFtpLocalError = 451, ///< Requested action aborted, local error in processing + sfFtpInsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable + + // 5xx: the command was not accepted and + // the requested action did not take place + sfFtpCommandUnknown = 500, ///< Syntax error, command unrecognized + sfFtpParametersUnknown = 501, ///< Syntax error in parameters or arguments + sfFtpCommandNotImplemented = 502, ///< Command not implemented + sfFtpBadCommandSequence = 503, ///< Bad sequence of commands + sfFtpParameterNotImplemented = 504, ///< Command not implemented for that parameter + sfFtpNotLoggedIn = 530, ///< Not logged in + sfFtpNeedAccountToStore = 532, ///< Need account for storing files + sfFtpFileUnavailable = 550, ///< Requested action not taken, file unavailable + sfFtpPageTypeUnknown = 551, ///< Requested action aborted, page type unknown + sfFtpNotEnoughMemory = 552, ///< Requested file action aborted, exceeded storage allocation + sfFtpFilenameNotAllowed = 553, ///< Requested action not taken, file name not allowed + + // 10xx: SFML custom codes + sfFtpInvalidResponse = 1000, ///< Response is not a valid FTP one + sfFtpConnectionFailed = 1001, ///< Connection with server failed + sfFtpConnectionClosed = 1002, ///< Connection with server closed + sfFtpInvalidFile = 1003 ///< Invalid file to upload / download +} sfFtpStatus; + + +//////////////////////////////////////////////////////////// +/// \brief Destroy a FTP listing response +/// +/// \param ftpListingResponse Ftp listing response to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse); + +//////////////////////////////////////////////////////////// +/// \brief Check if a FTP listing response status code means a success +/// +/// This function is defined for convenience, it is +/// equivalent to testing if the status code is < 400. +/// +/// \param ftpListingResponse Ftp listing response +/// +/// \return sfTrue if the status is a success, sfFalse if it is a failure +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the status code of a FTP listing response +/// +/// \param ftpListingResponse Ftp listing response +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_getStatus(const sfFtpListingResponse* ftpListingResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the full message contained in a FTP listing response +/// +/// \param ftpListingResponse Ftp listing response +/// +/// \return The response message +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse); + +//////////////////////////////////////////////////////////// +/// \brief Return the number of directory/file names contained in a FTP listing response +/// +/// \param ftpListingResponse Ftp listing response +/// +/// \return Total number of names available +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse); + +//////////////////////////////////////////////////////////// +/// \brief Return a directory/file name contained in a FTP listing response +/// +/// \param ftpListingResponse Ftp listing response +/// \param index Index of the name to get (in range [0 .. getCount]) +/// +/// \return The requested name +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfFtpListingResponse_getName(const sfFtpListingResponse* ftpListingResponse, size_t index); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a FTP directory response +/// +/// \param ftpDirectoryResponse Ftp directory response to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse); + +//////////////////////////////////////////////////////////// +/// \brief Check if a FTP directory response status code means a success +/// +/// This function is defined for convenience, it is +/// equivalent to testing if the status code is < 400. +/// +/// \param ftpDirectoryResponse Ftp directory response +/// +/// \return sfTrue if the status is a success, sfFalse if it is a failure +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the status code of a FTP directory response +/// +/// \param ftpDirectoryResponse Ftp directory response +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpStatus sfFtpDirectoryResponse_getStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the full message contained in a FTP directory response +/// +/// \param ftpDirectoryResponse Ftp directory response +/// +/// \return The response message +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the directory returned in a FTP directory response +/// +/// \param ftpDirectoryResponse Ftp directory response +/// +/// \return Directory name +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse); + + +//////////////////////////////////////////////////////////// +/// \brief Destroy a FTP response +/// +/// \param ftpResponse Ftp response to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfFtpResponse_destroy(sfFtpResponse* ftpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Check if a FTP response status code means a success +/// +/// This function is defined for convenience, it is +/// equivalent to testing if the status code is < 400. +/// +/// \param ftpResponse Ftp response object +/// +/// \return sfTrue if the status is a success, sfFalse if it is a failure +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the status code of a FTP response +/// +/// \param ftpResponse Ftp response object +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpStatus sfFtpResponse_getStatus(const sfFtpResponse* ftpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the full message contained in a FTP response +/// +/// \param ftpResponse Ftp response object +/// +/// \return The response message +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfFtpResponse_getMessage(const sfFtpResponse* ftpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Create a new Ftp object +/// +/// \return A new sfFtp object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtp* sfFtp_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a Ftp object +/// +/// \param ftp Ftp object to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfFtp_destroy(sfFtp* ftp); + +//////////////////////////////////////////////////////////// +/// \brief Connect to the specified FTP server +/// +/// The port should be 21, which is the standard +/// port used by the FTP protocol. You shouldn't use a different +/// value, unless you really know what you do. +/// This function tries to connect to the server so it may take +/// a while to complete, especially if the server is not +/// reachable. To avoid blocking your application for too long, +/// you can use a timeout. Using 0 means that the +/// system timeout will be used (which is usually pretty long). +/// +/// \param ftp Ftp object +/// \param server Name or address of the FTP server to connect to +/// \param port Port used for the connection +/// \param timeout Maximum time to wait +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout); + +//////////////////////////////////////////////////////////// +/// \brief Log in using an anonymous account +/// +/// Logging in is mandatory after connecting to the server. +/// Users that are not logged in cannot perform any operation. +/// +/// \param ftp Ftp object +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp); + +//////////////////////////////////////////////////////////// +/// \brief Log in using a username and a password +/// +/// Logging in is mandatory after connecting to the server. +/// Users that are not logged in cannot perform any operation. +/// +/// \param ftp Ftp object +/// \param name User name +/// \param password Password +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password); + +//////////////////////////////////////////////////////////// +/// \brief Close the connection with the server +/// +/// \param ftp Ftp object +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_disconnect(sfFtp* ftp); + +//////////////////////////////////////////////////////////// +/// \brief Send a null command to keep the connection alive +/// +/// This command is useful because the server may close the +/// connection automatically if no command is sent. +/// +/// \param ftp Ftp object +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_keepAlive(sfFtp* ftp); + +//////////////////////////////////////////////////////////// +/// \brief Get the current working directory +/// +/// The working directory is the root path for subsequent +/// operations involving directories and/or filenames. +/// +/// \param ftp Ftp object +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpDirectoryResponse* sfFtp_getWorkingDirectory(sfFtp* ftp); + +//////////////////////////////////////////////////////////// +/// \brief Get the contents of the given directory +/// +/// This function retrieves the sub-directories and files +/// contained in the given directory. It is not recursive. +/// The \a directory parameter is relative to the current +/// working directory. +/// +/// \param ftp Ftp object +/// \param directory Directory to list +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpListingResponse* sfFtp_getDirectoryListing(sfFtp* ftp, const char* directory); + +//////////////////////////////////////////////////////////// +/// \brief Change the current working directory +/// +/// The new directory must be relative to the current one. +/// +/// \param ftp Ftp object +/// \param directory New working directory +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_changeDirectory(sfFtp* ftp, const char* directory); + +//////////////////////////////////////////////////////////// +/// \brief Go to the parent directory of the current one +/// +/// \param ftp Ftp object +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_parentDirectory(sfFtp* ftp); + +//////////////////////////////////////////////////////////// +/// \brief Create a new directory +/// +/// The new directory is created as a child of the current +/// working directory. +/// +/// \param ftp Ftp object +/// \param name Name of the directory to create +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_createDirectory(sfFtp* ftp, const char* name); + +//////////////////////////////////////////////////////////// +/// \brief Remove an existing directory +/// +/// The directory to remove must be relative to the +/// current working directory. +/// Use this function with caution, the directory will +/// be removed permanently! +/// +/// \param ftp Ftp object +/// \param name Name of the directory to remove +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteDirectory(sfFtp* ftp, const char* name); + +//////////////////////////////////////////////////////////// +/// \brief Rename an existing file +/// +/// The filenames must be relative to the current working +/// directory. +/// +/// \param ftp Ftp object +/// \param file File to rename +/// \param newName New name of the file +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_renameFile(sfFtp* ftp, const char* file, const char* newName); + +//////////////////////////////////////////////////////////// +/// \brief Remove an existing file +/// +/// The file name must be relative to the current working +/// directory. +/// Use this function with caution, the file will be +/// removed permanently! +/// +/// \param ftp Ftp object +/// \param name File to remove +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name); + +//////////////////////////////////////////////////////////// +/// \brief Download a file from a FTP server +/// +/// The filename of the distant file is relative to the +/// current working directory of the server, and the local +/// destination path is relative to the current directory +/// of your application. +/// +/// \param ftp Ftp object +/// \param remoteFile Filename of the distant file to download +/// \param localPath Where to put to file on the local computer +/// \param mode Transfer mode +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode); + +//////////////////////////////////////////////////////////// +/// \brief Upload a file to a FTP server +/// +/// The name of the local file is relative to the current +/// working directory of your application, and the +/// remote path is relative to the current directory of the +/// FTP server. +/// +/// \param ftp Ftp object +/// \param localFile Path of the local file to upload +/// \param remotePath Where to put to file on the server +/// \param mode Transfer mode +/// +/// \return Server response to the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode); + + +#endif // SFML_FTP_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Http.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Http.h new file mode 100755 index 0000000..854f6bb --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Http.h @@ -0,0 +1,302 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_HTTP_H +#define SFML_HTTP_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/Types.h> +#include <SFML/System/Time.h> + + +//////////////////////////////////////////////////////////// +/// \brief Enumerate the available HTTP methods for a request +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfHttpGet, ///< Request in get mode, standard method to retrieve a page + sfHttpPost, ///< Request in post mode, usually to send data to a page + sfHttpHead ///< Request a page's header only +} sfHttpMethod; + + +//////////////////////////////////////////////////////////// +/// \brief Enumerate all the valid status codes for a response +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + // 2xx: success + sfHttpOk = 200, ///< Most common code returned when operation was successful + sfHttpCreated = 201, ///< The resource has successfully been created + sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server + sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return + sfHttpResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent + sfHttpPartialContent = 206, ///< The server has sent a part of the resource, as a response to a partial GET request + + // 3xx: redirection + sfHttpMultipleChoices = 300, ///< The requested page can be accessed from several locations + sfHttpMovedPermanently = 301, ///< The requested page has permanently moved to a new location + sfHttpMovedTemporarily = 302, ///< The requested page has temporarily moved to a new location + sfHttpNotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed + + // 4xx: client error + sfHttpBadRequest = 400, ///< The server couldn't understand the request (syntax error) + sfHttpUnauthorized = 401, ///< The requested page needs an authentification to be accessed + sfHttpForbidden = 403, ///< The requested page cannot be accessed at all, even with authentification + sfHttpNotFound = 404, ///< The requested page doesn't exist + sfHttpRangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field) + + // 5xx: server error + sfHttpInternalServerError = 500, ///< The server encountered an unexpected error + sfHttpNotImplemented = 501, ///< The server doesn't implement a requested feature + sfHttpBadGateway = 502, ///< The gateway server has received an error from the source server + sfHttpServiceNotAvailable = 503, ///< The server is temporarily unavailable (overloaded, in maintenance, ...) + sfHttpGatewayTimeout = 504, ///< The gateway server couldn't receive a response from the source server + sfHttpVersionNotSupported = 505, ///< The server doesn't support the requested HTTP version + + // 10xx: SFML custom codes + sfHttpInvalidResponse = 1000, ///< Response is not a valid HTTP one + sfHttpConnectionFailed = 1001 ///< Connection with server failed +} sfHttpStatus; + + +//////////////////////////////////////////////////////////// +/// \brief Create a new HTTP request +/// +/// \return A new sfHttpRequest object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a HTTP request +/// +/// \param httpRequest HTTP request to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpRequest_destroy(sfHttpRequest* httpRequest); + +//////////////////////////////////////////////////////////// +/// \brief Set the value of a header field of a HTTP request +/// +/// The field is created if it doesn't exist. The name of +/// the field is case insensitive. +/// By default, a request doesn't contain any field (but the +/// mandatory fields are added later by the HTTP client when +/// sending the request). +/// +/// \param httpRequest HTTP request +/// \param field Name of the field to set +/// \param value Value of the field +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpRequest_setField(sfHttpRequest* httpRequest, const char* field, const char* value); + +//////////////////////////////////////////////////////////// +/// \brief Set a HTTP request method +/// +/// See the sfHttpMethod enumeration for a complete list of all +/// the availale methods. +/// The method is sfHttpGet by default. +/// +/// \param httpRequest HTTP request +/// \param method Method to use for the request +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpRequest_setMethod(sfHttpRequest* httpRequest, sfHttpMethod method); + +//////////////////////////////////////////////////////////// +/// \brief Set a HTTP request URI +/// +/// The URI is the resource (usually a web page or a file) +/// that you want to get or post. +/// The URI is "/" (the root page) by default. +/// +/// \param httpRequest HTTP request +/// \param uri URI to request, relative to the host +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpRequest_setUri(sfHttpRequest* httpRequest, const char* uri); + +//////////////////////////////////////////////////////////// +/// \brief Set the HTTP version of a HTTP request +/// +/// The HTTP version is 1.0 by default. +/// +/// \param httpRequest HTTP request +/// \param major Major HTTP version number +/// \param minor Minor HTTP version number +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpRequest_setHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor); + +//////////////////////////////////////////////////////////// +/// \brief Set the body of a HTTP request +/// +/// The body of a request is optional and only makes sense +/// for POST requests. It is ignored for all other methods. +/// The body is empty by default. +/// +/// \param httpRequest HTTP request +/// \param body Content of the body +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpRequest_setBody(sfHttpRequest* httpRequest, const char* body); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a HTTP response +/// +/// \param httpResponse HTTP response to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttpResponse_destroy(sfHttpResponse* httpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the value of a field of a HTTP response +/// +/// If the field \a field is not found in the response header, +/// the empty string is returned. This function uses +/// case-insensitive comparisons. +/// +/// \param httpResponse HTTP response +/// \param field Name of the field to get +/// +/// \return Value of the field, or empty string if not found +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfHttpResponse_getField(const sfHttpResponse* httpResponse, const char* field); + +//////////////////////////////////////////////////////////// +/// \brief Get the status code of a HTTP reponse +/// +/// The status code should be the first thing to be checked +/// after receiving a response, it defines whether it is a +/// success, a failure or anything else (see the sfHttpStatus +/// enumeration). +/// +/// \param httpResponse HTTP response +/// +/// \return Status code of the response +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfHttpStatus sfHttpResponse_getStatus(const sfHttpResponse* httpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the major HTTP version number of a HTTP response +/// +/// \param httpResponse HTTP response +/// +/// \return Major HTTP version number +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API unsigned int sfHttpResponse_getMajorVersion(const sfHttpResponse* httpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the minor HTTP version number of a HTTP response +/// +/// \param httpResponse HTTP response +/// +/// \return Minor HTTP version number +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API unsigned int sfHttpResponse_getMinorVersion(const sfHttpResponse* httpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Get the body of a HTTP response +/// +/// The body of a response may contain: +/// \li the requested page (for GET requests) +/// \li a response from the server (for POST requests) +/// \li nothing (for HEAD requests) +/// \li an error message (in case of an error) +/// +/// \param httpResponse HTTP response +/// +/// \return The response body +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const char* sfHttpResponse_getBody(const sfHttpResponse* httpResponse); + +//////////////////////////////////////////////////////////// +/// \brief Create a new Http object +/// +/// \return A new sfHttp object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfHttp* sfHttp_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a Http object +/// +/// \param http Http object to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfHttp_destroy(sfHttp* http); + +//////////////////////////////////////////////////////////// +/// \brief Set the target host of a HTTP object +/// +/// This function just stores the host address and port, it +/// doesn't actually connect to it until you send a request. +/// If the port is 0, it means that the HTTP client will use +/// the right port according to the protocol used +/// (80 for HTTP, 443 for HTTPS). You should +/// leave it like this unless you really need a port other +/// than the standard one, or use an unknown protocol. +/// +/// \param http Http object +/// \param host Web server to connect to +/// \param port Port to use for connection +/// +//////////////////////////////////////////////////////////// +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. +/// +/// You must have a valid host before sending a request (see sfHttp_setHost). +/// Any missing mandatory header field in the request will be added +/// with an appropriate value. +/// Warning: this function waits for the server's response and may +/// not return instantly; use a thread if you don't want to block your +/// application, or use a timeout to limit the time to wait. A value +/// of 0 means that the client will use the system defaut timeout +/// (which is usually pretty long). +/// +/// \param http Http object +/// \param request Request to send +/// \param timeout Maximum time to wait +/// +/// \return Server's response +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfHttpResponse* sfHttp_sendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout); + + +#endif // SFML_HTTP_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/IpAddress.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/IpAddress.h new file mode 100755 index 0000000..af3c3d0 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/IpAddress.h @@ -0,0 +1,176 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_IPADDRESS_H +#define SFML_IPADDRESS_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/System/Time.h> + + +//////////////////////////////////////////////////////////// +/// \brief Encapsulate an IPv4 network address +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + char address[16]; +} sfIpAddress; + + +//////////////////////////////////////////////////////////// +/// \brief Empty object that represents invalid addresses +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const sfIpAddress sfIpAddress_None; + +//////////////////////////////////////////////////////////// +/// \brief Local host IP address (127.0.0.1, or "localhost") +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const sfIpAddress sfIpAddress_LocalHost; + +//////////////////////////////////////////////////////////// +/// \brief UDP broadcast address (255.255.255.255) +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const sfIpAddress sfIpAddress_Broadcast; + +//////////////////////////////////////////////////////////// +/// \brief Create an address from a string +/// +/// Here \a address can be either a decimal address +/// (ex: "192.168.1.56") or a network name (ex: "localhost"). +/// +/// \param address IP address or network name +/// +/// \return Resulting 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 +/// as it doesn't have to parse a string to get the address +/// components. +/// +/// \param byte0 First byte of the address +/// \param byte1 Second byte of the address +/// \param byte2 Third byte of the address +/// \param byte3 Fourth byte of the address +/// +/// \return Resulting address +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3); + +//////////////////////////////////////////////////////////// +/// \brief Construct an address from a 32-bits integer +/// +/// This function uses the internal representation of +/// the address directly. It should be used for optimization +/// purposes, and only if you got that representation from +/// sfIpAddress_ToInteger. +/// +/// \param address 4 bytes of the address packed into a 32-bits integer +/// +/// \return Resulting address +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address); + +//////////////////////////////////////////////////////////// +/// \brief Get a string representation of an address +/// +/// The returned string is the decimal representation of the +/// IP address (like "192.168.1.56"), even if it was constructed +/// from a host name. +/// +/// \param address Address object +/// +/// \return String representation of the address +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string); + +//////////////////////////////////////////////////////////// +/// \brief Get an integer representation of the address +/// +/// The returned number is the internal representation of the +/// address, and should be used for optimization purposes only +/// (like sending the address through a socket). +/// The integer produced by this function can then be converted +/// back to a sfIpAddress with sfIpAddress_FromInteger. +/// +/// \param address Address object +/// +/// \return 32-bits unsigned integer representation of the address +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfUint32 sfIpAddress_toInteger(sfIpAddress address); + +//////////////////////////////////////////////////////////// +/// \brief Get the computer's local 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 +/// and may be used safely anywhere. +/// +/// \return Local IP address of the computer +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfIpAddress sfIpAddress_getLocalAddress(void); + +//////////////////////////////////////////////////////////// +/// \brief Get the computer's public address +/// +/// The public address is the address of the computer from the +/// internet point of view, i.e. something like 89.54.1.169. +/// It is necessary for communications over the world wide web. +/// The only way to get a public address is to ask it to a +/// distant website; as a consequence, this function depends on +/// both your network connection and the server, and may be +/// very slow. You should use it as few as possible. Because +/// this function depends on the network connection and on a distant +/// server, you may use a time limit if you don't want your program +/// to be possibly stuck waiting in case there is a problem; use +/// 0 to deactivate this limit. +/// +/// \param timeout Maximum time to wait +/// +/// \return Public IP address of the computer +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfIpAddress sfIpAddress_getPublicAddress(sfTime timeout); + + +#endif // SFML_IPADDRESS_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Packet.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Packet.h new file mode 100755 index 0000000..75fc95d --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Packet.h @@ -0,0 +1,177 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_PACKET_H +#define SFML_PACKET_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/Types.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new packet +/// +/// \return A new sfPacket object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfPacket* sfPacket_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Create a new packet by copying an existing one +/// +/// \param packet Packet to copy +/// +/// \return A new sfPacket object which is a copy of \a packet +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfPacket* sfPacket_copy(const sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a packet +/// +/// \param packet Packet to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfPacket_destroy(sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Append data to the end of a packet +/// +/// \param packet Packet object +/// \param data Pointer to the sequence of bytes to append +/// \param sizeInBytes Number of bytes to append +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes); + +//////////////////////////////////////////////////////////// +/// \brief Clear a packet +/// +/// After calling Clear, the packet is empty. +/// +/// \param packet Packet object +/// +/////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfPacket_clear(sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Get a pointer to the data contained in a packet +/// +/// Warning: the returned pointer may become invalid after +/// you append data to the packet, therefore it should never +/// be stored. +/// The return pointer is NULL if the packet is empty. +/// +/// \param packet Packet object +/// +/// \return Pointer to the data +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API const void* 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. +/// +/// \param packet Packet object +/// +/// \return Data size, in bytes +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API size_t sfPacket_getDataSize(const sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Tell if the reading position has reached the +/// end of a packet +/// +/// This function is useful to know if there is some data +/// left to be read, without actually reading it. +/// +/// \param packet Packet object +/// +/// \return sfTrue if all data was read, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfPacket_endOfPacket(const sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Test the validity of a packet, for reading +/// +/// This function allows to test the packet, to check if +/// a reading operation was successful. +/// +/// A packet will be in an invalid state if it has no more +/// data to read. +/// +/// \param packet Packet object +/// +/// \return sfTrue if last data extraction from packet was successful +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfPacket_canRead(const sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Functions to extract data from a 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); + +//////////////////////////////////////////////////////////// +/// \brief Functions to insert data into a packet +/// +/// \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); + + +#endif // SFML_PACKET_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/SocketSelector.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/SocketSelector.h new file mode 100755 index 0000000..2480c98 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/SocketSelector.h @@ -0,0 +1,141 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOCKETSELECTOR_H +#define SFML_SOCKETSELECTOR_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/Types.h> +#include <SFML/System/Time.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new selector +/// +/// \return A new sfSocketSelector object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Create a new socket selector by copying an existing one +/// +/// \param selector Socket selector to copy +/// +/// \return A new sfSocketSelector object which is a copy of \a selector +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy(const sfSocketSelector* selector); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a socket selector +/// +/// \param selector Socket selector to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfSocketSelector_destroy(sfSocketSelector* selector); + +//////////////////////////////////////////////////////////// +/// \brief Add a new socket to a socket selector +/// +/// This function keeps a weak pointer to the socket, +/// so you have to make sure that the socket is not destroyed +/// while it is stored in the selector. +/// +/// \param selector Socket selector object +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Remove a socket from a socket selector +/// +/// This function doesn't destroy the socket, it simply +/// removes the pointer that the selector has to it. +/// +/// \param selector Socket selector object +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Remove all the sockets stored in a selector +/// +/// This function doesn't destroy any instance, it simply +/// removes all the pointers that the selector has to +/// external sockets. +/// +/// \param selector Socket selector object +/// +//////////////////////////////////////////////////////////// +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. +/// If you use a timeout and no socket is ready before the timeout +/// is over, the function returns sfFalse. +/// +/// \param selector Socket selector object +/// \param timeout Maximum time to wait (use sfTimeZero for infinity) +/// +/// \return sfTrue if there are sockets ready, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout); + +//////////////////////////////////////////////////////////// +/// \brief Test a socket to know if it is ready to receive data +/// +/// This function must be used after a call to +/// sfSocketSelector_wait, to know which sockets are ready to +/// receive data. If a socket is ready, a call to Receive will +/// never block because we know that there is data available to read. +/// Note that if this function returns sfTrue for a sfTcpListener, +/// this means that it is ready to accept a new connection. +/// +/// \param selector Socket selector object +/// \param socket Socket to test +/// +/// \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); + + +#endif // SFML_SOCKETSELECTOR_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/SocketStatus.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/SocketStatus.h new file mode 100755 index 0000000..421e516 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/SocketStatus.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SOCKETSTATUS_H +#define SFML_SOCKETSTATUS_H + + +//////////////////////////////////////////////////////////// +/// \brief Define the status that can be returned by the socket functions +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfSocketDone, ///< The socket has sent / received the data + sfSocketNotReady, ///< The socket is not ready to send / receive data yet + sfSocketDisconnected, ///< The TCP socket has been disconnected + sfSocketError ///< An unexpected error happened + +} sfSocketStatus; + + +#endif // SFML_SOCKETSTATUS_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/TcpListener.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/TcpListener.h new file mode 100755 index 0000000..f0fdfca --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/TcpListener.h @@ -0,0 +1,128 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TCPLISTENER_H +#define SFML_TCPLISTENER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/SocketStatus.h> +#include <SFML/Network/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new TCP listener +/// +/// \return A new sfTcpListener object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfTcpListener* sfTcpListener_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a TCP listener +/// +/// \param listener TCP listener to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfTcpListener_destroy(sfTcpListener* listener); + +//////////////////////////////////////////////////////////// +/// \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 +/// sfTcpListener_accept in blocking mode won't return until +/// a new connection was actually received. +/// In non-blocking mode, calls will always return immediately, +/// using the return code to signal whether there was data +/// available or not. +/// By default, all sockets are blocking. +/// +/// \param listener TCP listener object +/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a TCP listener is in blocking or non-blocking mode +/// +/// \param listener TCP listener object +/// +/// \return sfTrue if the socket is blocking, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfTcpListener_isBlocking(const sfTcpListener* listener); + +//////////////////////////////////////////////////////////// +/// \brief Get the port to which a TCP listener is bound locally +/// +/// If the socket is not listening to a port, this function +/// returns 0. +/// +/// \param listener TCP listener object +/// +/// \return Port to which the TCP listener is bound +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener); + +//////////////////////////////////////////////////////////// +/// \brief Start listening for connections +/// +/// This functions makes the socket listen to the specified +/// port, waiting for new connections. +/// If the socket was previously listening to another port, +/// it will be stopped first and bound to the new port. +/// +/// \param listener TCP listener object +/// \param port Port to listen for new connections +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port); + +//////////////////////////////////////////////////////////// +/// \brief Accept a new connection +/// +/// If the socket is in blocking mode, this function will +/// not return until a connection is actually received. +/// +/// The \a connected argument points to a valid sfTcpSocket pointer +/// in case of success (the function returns sfSocketDone), it points +/// to a NULL pointer otherwise. +/// +/// \param listener TCP listener object +/// \param connected Socket that will hold the new connection +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** connected); + + +#endif // SFML_TCPLISTENER_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/TcpSocket.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/TcpSocket.h new file mode 100755 index 0000000..2911c00 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/TcpSocket.h @@ -0,0 +1,210 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TCPSOCKET_H +#define SFML_TCPSOCKET_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/IpAddress.h> +#include <SFML/Network/SocketStatus.h> +#include <SFML/Network/Types.h> +#include <SFML/System/Time.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new TCP socket +/// +/// \return A new sfTcpSocket object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a TCP socket +/// +/// \param socket TCP socket to destroy +/// +//////////////////////////////////////////////////////////// +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 +/// new data was actually received. +/// In non-blocking mode, calls will always return immediately, +/// using the return code to signal whether there was data +/// available or not. +/// By default, all sockets are blocking. +/// +/// \param socket TCP socket object +/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a TCP socket is in blocking or non-blocking mode +/// +/// \param socket TCP socket object +/// +/// \return sfTrue if the socket is blocking, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket); + +//////////////////////////////////////////////////////////// +/// \brief Get the port to which a TCP socket is bound locally +/// +/// If the socket is not connected, this function returns 0. +/// +/// \param socket TCP socket object +/// +/// \return Port to which the socket is bound +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param socket TCP socket object +/// +/// \return Address of the remote peer +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfIpAddress sfTcpSocket_getRemoteAddress(const sfTcpSocket* socket); + +//////////////////////////////////////////////////////////// +/// \brief Get the port of the connected peer to which +/// a TCP socket is connected +/// +/// If the socket is not connected, this function returns 0. +/// +/// \param socket TCP socket object +/// +/// \return Remote port to which the socket is connected +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket); + +//////////////////////////////////////////////////////////// +/// \brief Connect a TCP socket to a remote peer +/// +/// In blocking mode, this function may take a while, especially +/// if the remote peer is not reachable. The last parameter allows +/// you to stop trying to connect after a given timeout. +/// If the socket was previously connected, it is first disconnected. +/// +/// \param socket TCP socket object +/// \param remoteAddress Address of the remote peer +/// \param remotePort Port of the remote peer +/// \param timeout Maximum time to wait +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout); + +//////////////////////////////////////////////////////////// +/// \brief Disconnect a TCP socket from its remote peer +/// +/// This function gracefully closes the connection. If the +/// socket is not connected, this function has no effect. +/// +/// \param socket TCP socket object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket); + +//////////////////////////////////////////////////////////// +/// \brief Send raw data to the remote peer of a TCP socket +/// +/// This function will fail if the socket is not connected. +/// +/// \param socket TCP socket object +/// \param data Pointer to the sequence of bytes to send +/// \param size Number of bytes to send +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size); + +//////////////////////////////////////////////////////////// +/// \brief Receive raw data from the remote peer of a TCP socket +/// +/// In blocking mode, this function will wait until some +/// bytes are actually received. +/// This function will fail if the socket is not connected. +/// +/// \param socket TCP socket object +/// \param data Pointer to the array to fill with the received bytes +/// \param size Maximum number of bytes that can be received +/// \param received This variable is filled with the actual number of bytes received +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived); + +//////////////////////////////////////////////////////////// +/// \brief Send a formatted packet of data to the remote peer of a TCP socket +/// +/// This function will fail if the socket is not connected. +/// +/// \param socket TCP socket object +/// \param packet Packet to send +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPacket(sfTcpSocket* socket, sfPacket* packet); + +//////////////////////////////////////////////////////////// +/// \brief Receive a formatted packet of data from the remote peer +/// +/// In blocking mode, this function will wait until the whole packet +/// has been received. +/// This function will fail if the socket is not connected. +/// +/// \param socket TCP socket object +/// \param packet Packet to fill with the received data +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receivePacket(sfTcpSocket* socket, sfPacket* packet); + + +#endif // SFML_TCPSOCKET_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Types.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Types.h new file mode 100755 index 0000000..60378a1 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/Types.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_NETWORK_TYPES_H +#define SFML_NETWORK_TYPES_H + + +typedef struct sfFtpDirectoryResponse sfFtpDirectoryResponse; +typedef struct sfFtpListingResponse sfFtpListingResponse; +typedef struct sfFtpResponse sfFtpResponse; +typedef struct sfFtp sfFtp; +typedef struct sfHttpRequest sfHttpRequest; +typedef struct sfHttpResponse sfHttpResponse; +typedef struct sfHttp sfHttp; +typedef struct sfPacket sfPacket; +typedef struct sfSocketSelector sfSocketSelector; +typedef struct sfTcpListener sfTcpListener; +typedef struct sfTcpSocket sfTcpSocket; +typedef struct sfUdpSocket sfUdpSocket; + + +#endif // SFML_NETWORK_TYPES_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/UdpSocket.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/UdpSocket.h new file mode 100755 index 0000000..527d153 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Network/UdpSocket.h @@ -0,0 +1,206 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_UDPSOCKET_H +#define SFML_UDPSOCKET_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Network/Export.h> +#include <SFML/Network/IpAddress.h> +#include <SFML/Network/SocketStatus.h> +#include <SFML/Network/Types.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new UDP socket +/// +/// \return A new sfUdpSocket object +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a UDP socket +/// +/// \param socket UDP socket to destroy +/// +//////////////////////////////////////////////////////////// +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 +/// new data was actually received. +/// In non-blocking mode, calls will always return immediately, +/// using the return code to signal whether there was data +/// available or not. +/// By default, all sockets are blocking. +/// +/// \param socket UDP socket object +/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether a UDP socket is in blocking or non-blocking mode +/// +/// \param socket UDP socket object +/// +/// \return sfTrue if the socket is blocking, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket); + +//////////////////////////////////////////////////////////// +/// \brief Get the port to which a UDP socket is bound locally +/// +/// If the socket is not bound to a port, this function +/// returns 0. +/// +/// \param socket UDP socket object +/// +/// \return Port to which the socket is bound +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket); + +//////////////////////////////////////////////////////////// +/// \brief Bind a UDP socket to a specific port +/// +/// Binding the socket to a port is necessary for being +/// 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. +/// +/// \param socket UDP socket object +/// \param port Port to bind the socket to +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +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 +/// +/// The port that the socket was previously using is immediately +/// available after this function is called. If the +/// socket is not bound to a port, this function has no effect. +/// +/// \param socket UDP socket object +/// +//////////////////////////////////////////////////////////// +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 +/// fail and no data will be sent. +/// +/// \param socket UDP socket object +/// \param data Pointer to the sequence of bytes to send +/// \param size Number of bytes to send +/// \param remoteAddress Address of the receiver +/// \param remotePort Port of the receiver to send the data to +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port); + +//////////////////////////////////////////////////////////// +/// \brief Receive raw data from a remote peer with a UDP socket +/// +/// In blocking mode, this function will wait until some +/// bytes are actually received. +/// Be careful to use a buffer which is large enough for +/// the data that you intend to receive, if it is too small +/// then an error will be returned and *all* the data will +/// be lost. +/// +/// \param socket UDP socket object +/// \param data Pointer to the array to fill with the received bytes +/// \param size Maximum number of bytes that can be received +/// \param received This variable is filled with the actual number of bytes received +/// \param remoteAddress Address of the peer that sent the data +/// \param remotePort Port of the peer that sent the data +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* 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 +/// fail and no data will be sent. +/// +/// \param socket UDP socket object +/// \param packet Packet to send +/// \param remoteAddress Address of the receiver +/// \param remotePort Port of the receiver to send the data to +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +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. +/// +/// \param packet Packet to fill with the received data +/// \param remoteAddress Address of the peer that sent the data +/// \param remotePort Port of the peer that sent the data +/// +/// \return Status code +/// +//////////////////////////////////////////////////////////// +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 +/// sent in a single UDP datagram +/// +/// \return The maximum size of a UDP datagram (message) +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize(); + + +#endif // SFML_UDPSOCKET_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/OpenGL.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/OpenGL.h new file mode 100755 index 0000000..ffc9f88 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/OpenGL.h @@ -0,0 +1,58 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_OPENGL_H +#define SFML_OPENGL_H + + +//////////////////////////////////////////////////////////// +/// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Config.h> + + +//////////////////////////////////////////////////////////// +/// This file just includes the OpenGL (GL and GLU) headers, +/// which have actually different paths on each system +//////////////////////////////////////////////////////////// +#if defined(CSFML_SYSTEM_WINDOWS) + + #include <windows.h> + #include <GL/gl.h> + #include <GL/glu.h> + +#elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD) + + #include <GL/gl.h> + #include <GL/glu.h> + +#elif defined(CSFML_SYSTEM_MACOS) + + #include <OpenGL/gl.h> + #include <OpenGL/glu.h> + +#endif + + +#endif // SFML_OPENGL_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System.h new file mode 100755 index 0000000..a982ae2 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System.h @@ -0,0 +1,42 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SYSTEM_H +#define SFML_SYSTEM_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// + +#include <SFML/Config.h> +#include <SFML/System/Clock.h> +#include <SFML/System/InputStream.h> +#include <SFML/System/Mutex.h> +#include <SFML/System/Sleep.h> +#include <SFML/System/Thread.h> +#include <SFML/System/Vector2.h> +#include <SFML/System/Vector3.h> + + +#endif // SFML_SYSTEM_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Clock.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Clock.h new file mode 100755 index 0000000..be2eb60 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Clock.h @@ -0,0 +1,90 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_CLOCK_H +#define SFML_CLOCK_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> +#include <SFML/System/Time.h> +#include <SFML/System/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new clock and start it +/// +/// \return A new sfClock object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfClock* sfClock_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Create a new clock by copying an existing one +/// +/// \param clock Clock to copy +/// +/// \return A new sfClock object which is a copy of \a clock +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfClock* sfClock_copy(const sfClock* clock); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a clock +/// +/// \param clock Clock to destroy +/// +//////////////////////////////////////////////////////////// +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). +/// +/// \param clock Clock object +/// +/// \return Time elapsed +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfTime sfClock_getElapsedTime(const sfClock* clock); + +//////////////////////////////////////////////////////////// +/// \brief Restart a clock +/// +/// This function puts the time counter back to zero. +/// It also returns the time elapsed since the clock was started. +/// +/// \param clock Clock object +/// +/// \return Time elapsed +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfTime sfClock_restart(sfClock* clock); + + +#endif // SFML_CLOCK_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Export.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Export.h new file mode 100755 index 0000000..a473954 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Export.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SYSTEM_EXPORT_H +#define SFML_SYSTEM_EXPORT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Config.h> + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(CSFML_SYSTEM_EXPORTS) + + #define CSFML_SYSTEM_API CSFML_API_EXPORT + +#else + + #define CSFML_SYSTEM_API CSFML_API_IMPORT + +#endif + + +#endif // SFML_SYSTEM_EXPORT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/InputStream.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/InputStream.h new file mode 100755 index 0000000..140ee42 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/InputStream.h @@ -0,0 +1,54 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_INPUTSTREAM_H +#define SFML_INPUTSTREAM_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> + + +typedef sfInt64 (*sfInputStreamReadFunc)(void* data, sfInt64 size, void* userData); +typedef sfInt64 (*sfInputStreamSeekFunc)(sfInt64 position, void* userData); +typedef sfInt64 (*sfInputStreamTellFunc)(void* userData); +typedef sfInt64 (*sfInputStreamGetSizeFunc)(void* userData); + + +//////////////////////////////////////////////////////////// +/// \brief Set of callbacks that allow users to define custom file streams +/// +//////////////////////////////////////////////////////////// +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 +} sfInputStream; + + +#endif // SFML_INPUTSTREAM_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Mutex.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Mutex.h new file mode 100755 index 0000000..3e054de --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Mutex.h @@ -0,0 +1,68 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_MUTEX_H +#define SFML_MUTEX_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> +#include <SFML/System/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new mutex +/// +/// \return A new sfMutex object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfMutex* sfMutex_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a mutex +/// +/// \param mutex Mutex to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfMutex_destroy(sfMutex* mutex); + +//////////////////////////////////////////////////////////// +/// \brief Lock a mutex +/// +/// \param mutex Mutex object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfMutex_lock(sfMutex* mutex); + +//////////////////////////////////////////////////////////// +/// \brief Unlock a mutex +/// +/// \param mutex Mutex object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfMutex_unlock(sfMutex* mutex); + + +#endif // SFML_MUTEX_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Sleep.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Sleep.h new file mode 100755 index 0000000..34fff1f --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Sleep.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SLEEP_H +#define SFML_SLEEP_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> +#include <SFML/System/Time.h> + + +//////////////////////////////////////////////////////////// +/// \brief Make the current thread sleep for a given duration +/// +/// sfSleep is the best way to block a program or one of its +/// threads, as it doesn't consume any CPU power. +/// +/// \param duration Time to sleep +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfSleep(sfTime duration); + + +#endif // SFML_SLEEP_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Thread.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Thread.h new file mode 100755 index 0000000..49aaa6f --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Thread.h @@ -0,0 +1,103 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_THREAD_H +#define SFML_THREAD_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> +#include <SFML/System/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new thread from a function pointer +/// +/// 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 +/// +/// \return A new sfThread object +/// +//////////////////////////////////////////////////////////// +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 +/// cannot survive after the sfThread object is destroyed. +/// +/// \param thread Thread to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfThread_destroy(sfThread* thread); + +//////////////////////////////////////////////////////////// +/// \brief Run a thread +/// +/// This function starts the entry point passed to the +/// thread's constructor, and returns immediately. +/// After this function returns, the thread's function is +/// running in parallel to the calling code. +/// +/// \param thread Thread object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfThread_launch(sfThread* thread); + +//////////////////////////////////////////////////////////// +/// \brief Wait until a thread finishes +/// +/// This function will block the execution until the +/// thread's function ends. +/// Warning: if the thread function never ends, the calling +/// thread will block forever. +/// If this function is called from its owner thread, it +/// returns without doing anything. +/// +/// \param thread Thread object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfThread_wait(sfThread* thread); + +//////////////////////////////////////////////////////////// +/// \brief Terminate a thread +/// +/// This function immediately stops the thread, without waiting +/// for its function to finish. +/// Terminating a thread with this function is not safe, +/// and can lead to local variables not being destroyed +/// on some operating systems. You should rather try to make +/// the thread function terminate by itself. +/// +/// \param thread Thread object +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API void sfThread_terminate(sfThread* thread); + + +#endif // SFML_THREAD_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Time.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Time.h new file mode 100755 index 0000000..b27b842 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Time.h @@ -0,0 +1,110 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_TIME_H +#define SFML_TIME_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Represents a time value +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfInt64 microseconds; +} sfTime; + +//////////////////////////////////////////////////////////// +/// \brief Predefined "zero" time value +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfTime sfTime_Zero; + +//////////////////////////////////////////////////////////// +/// \brief Return a time value as a number of seconds +/// +/// \param time Time value +/// +/// \return Time in seconds +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API float sfTime_asSeconds(sfTime time); + +//////////////////////////////////////////////////////////// +/// \brief Return a time value as a number of milliseconds +/// +/// \param time Time value +/// +/// \return Time in milliseconds +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfInt32 sfTime_asMilliseconds(sfTime time); + +//////////////////////////////////////////////////////////// +/// \brief Return a time value as a number of microseconds +/// +/// \param time Time value +/// +/// \return Time in microseconds +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfInt64 sfTime_asMicroseconds(sfTime time); + +//////////////////////////////////////////////////////////// +/// \brief Construct a time value from a number of seconds +/// +/// \param amount Number of seconds +/// +/// \return Time value constructed from the amount of seconds +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfTime sfSeconds(float amount); + +//////////////////////////////////////////////////////////// +/// \brief Construct a time value from a number of milliseconds +/// +/// \param amount Number of milliseconds +/// +/// \return Time value constructed from the amount of milliseconds +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfTime sfMilliseconds(sfInt32 amount); + +//////////////////////////////////////////////////////////// +/// \brief Construct a time value from a number of microseconds +/// +/// \param amount Number of microseconds +/// +/// \return Time value constructed from the amount of microseconds +/// +//////////////////////////////////////////////////////////// +CSFML_SYSTEM_API sfTime sfMicroseconds(sfInt64 amount); + + +#endif // SFML_TIME_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Types.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Types.h new file mode 100755 index 0000000..cea5ce4 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Types.h @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SYSTEM_TYPES_H +#define SFML_SYSTEM_TYPES_H + + +typedef struct sfClock sfClock; +typedef struct sfMutex sfMutex; +typedef struct sfThread sfThread; + + +#endif // SFML_SYSTEM_TYPES_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Vector2.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Vector2.h new file mode 100755 index 0000000..536de2c --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Vector2.h @@ -0,0 +1,67 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_VECTOR2_H +#define SFML_VECTOR2_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief 2-component vector of integers +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + int x; + int y; +} sfVector2i; + + +//////////////////////////////////////////////////////////// +/// \brief 2-component vector of unsigned integers +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + unsigned int x; + unsigned int y; +} sfVector2u; + + +//////////////////////////////////////////////////////////// +/// \brief 2-component vector of floats +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + float x; + float y; +} sfVector2f; + + +#endif // SFML_VECTOR2_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Vector3.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Vector3.h new file mode 100755 index 0000000..2e4729a --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/System/Vector3.h @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_VECTOR3_H +#define SFML_VECTOR3_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/System/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief 3-component vector of floats +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + float x; + float y; + float z; +} sfVector3f; + + +#endif // SFML_VECTOR3_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window.h new file mode 100755 index 0000000..1e2bab8 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window.h @@ -0,0 +1,42 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_SFML_WINDOW_H +#define SFML_SFML_WINDOW_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// + +#include <SFML/System.h> +#include <SFML/Window/Context.h> +#include <SFML/Window/Event.h> +#include <SFML/Window/Joystick.h> +#include <SFML/Window/Keyboard.h> +#include <SFML/Window/Mouse.h> +#include <SFML/Window/VideoMode.h> +#include <SFML/Window/Window.h> + + +#endif // SFML_SFML_WINDOW_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Context.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Context.h new file mode 100755 index 0000000..1053adb --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Context.h @@ -0,0 +1,63 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_CONTEXT_H +#define SFML_CONTEXT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> +#include <SFML/Window/Types.h> + + +//////////////////////////////////////////////////////////// +/// \brief Create a new context +/// +/// This function activates the new context. +/// +/// \return New sfContext object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfContext* sfContext_create(void); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a context +/// +/// \param context Context to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfContext_destroy(sfContext* context); + +//////////////////////////////////////////////////////////// +/// \brief Activate or deactivate explicitely a context +/// +/// \param context Context object +/// \param active sfTrue to activate, sfFalse to deactivate +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfContext_setActive(sfContext* context, sfBool active); + + +#endif // SFML_CONTEXT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Event.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Event.h new file mode 100755 index 0000000..cb4d141 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Event.h @@ -0,0 +1,189 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_EVENT_H +#define SFML_EVENT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> +#include <SFML/Window/Joystick.h> +#include <SFML/Window/Keyboard.h> +#include <SFML/Window/Mouse.h> + + +//////////////////////////////////////////////////////////// +/// \brief Definition of all the event types +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfEvtClosed, + sfEvtResized, + sfEvtLostFocus, + sfEvtGainedFocus, + sfEvtTextEntered, + sfEvtKeyPressed, + sfEvtKeyReleased, + sfEvtMouseWheelMoved, + sfEvtMouseButtonPressed, + sfEvtMouseButtonReleased, + sfEvtMouseMoved, + sfEvtMouseEntered, + sfEvtMouseLeft, + sfEvtJoystickButtonPressed, + sfEvtJoystickButtonReleased, + sfEvtJoystickMoved, + sfEvtJoystickConnected, + sfEvtJoystickDisconnected +} sfEventType; + + +//////////////////////////////////////////////////////////// +/// \brief Keyboard event parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + sfKeyCode code; + sfBool alt; + sfBool control; + sfBool shift; + sfBool system; +} sfKeyEvent; + +//////////////////////////////////////////////////////////// +/// \brief Text event parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + sfUint32 unicode; +} sfTextEvent; + +//////////////////////////////////////////////////////////// +/// \brief Mouse move event parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + int x; + int y; +} sfMouseMoveEvent; + +//////////////////////////////////////////////////////////// +/// \brief Mouse buttons events parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + sfMouseButton button; + int x; + int y; +} sfMouseButtonEvent; + +//////////////////////////////////////////////////////////// +/// \brief Mouse wheel events parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + int delta; + int x; + int y; +} sfMouseWheelEvent; + +//////////////////////////////////////////////////////////// +/// \brief Joystick axis move event parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + unsigned int joystickId; + sfJoystickAxis axis; + float position; +} sfJoystickMoveEvent; + +//////////////////////////////////////////////////////////// +/// \brief Joystick buttons events parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + unsigned int joystickId; + unsigned int button; +} sfJoystickButtonEvent; + +//////////////////////////////////////////////////////////// +/// \brief Joystick connection/disconnection event parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + unsigned int joystickId; +} sfJoystickConnectEvent; + +//////////////////////////////////////////////////////////// +/// \brief Size events parameters +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfEventType type; + unsigned int width; + unsigned int height; +} sfSizeEvent; + + +//////////////////////////////////////////////////////////// +/// \brief sfEvent defines a system event and its parameters +/// +//////////////////////////////////////////////////////////// +typedef union +{ + //////////////////////////////////////////////////////////// + // Member data + //////////////////////////////////////////////////////////// + sfEventType type; ///< Type of the event + sfSizeEvent size; + sfKeyEvent key; + sfTextEvent text; + sfMouseMoveEvent mouseMove; + sfMouseButtonEvent mouseButton; + sfMouseWheelEvent mouseWheel; + sfJoystickMoveEvent joystickMove; + sfJoystickButtonEvent joystickButton; + sfJoystickConnectEvent joystickConnect; +} sfEvent; + + +#endif // SFML_EVENT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Export.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Export.h new file mode 100755 index 0000000..f972fa3 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Export.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_WINDOW_EXPORT_H +#define SFML_WINDOW_EXPORT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Config.h> + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(CSFML_WINDOW_EXPORTS) + + #define CSFML_WINDOW_API CSFML_API_EXPORT + +#else + + #define CSFML_WINDOW_API CSFML_API_IMPORT + +#endif + + +#endif // SFML_WINDOW_EXPORT_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Joystick.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Joystick.h new file mode 100755 index 0000000..fd9bbc4 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Joystick.h @@ -0,0 +1,135 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_JOYSTICK_H +#define SFML_JOYSTICK_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Global joysticks capabilities +/// +//////////////////////////////////////////////////////////// +enum +{ + sfJoystickCount = 8, ///< Maximum number of supported joysticks + sfJoystickButtonCount = 32, ///< Maximum number of supported buttons + sfJoystickAxisCount = 8 ///< Maximum number of supported axes +}; + + +//////////////////////////////////////////////////////////// +/// \brief Axes supported by SFML joysticks +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfJoystickX, ///< The X axis + sfJoystickY, ///< The Y axis + sfJoystickZ, ///< The Z axis + sfJoystickR, ///< The R axis + sfJoystickU, ///< The U axis + sfJoystickV, ///< The V axis + sfJoystickPovX, ///< The X axis of the point-of-view hat + sfJoystickPovY ///< The Y axis of the point-of-view hat +} sfJoystickAxis; + + +//////////////////////////////////////////////////////////// +/// \brief Check if a joystick is connected +/// +/// \param joystick Index of the joystick to check +/// +/// \return sfTrue if the joystick is connected, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfJoystick_isConnected(unsigned int joystick); + +//////////////////////////////////////////////////////////// +/// \brief Return the number of buttons supported by a joystick +/// +/// If the joystick is not connected, this function returns 0. +/// +/// \param joystick Index of the joystick +/// +/// \return Number of buttons supported by the joystick +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API unsigned int sfJoystick_getButtonCount(unsigned int joystick); + +//////////////////////////////////////////////////////////// +/// \brief Check if a joystick supports a given axis +/// +/// If the joystick is not connected, this function returns false. +/// +/// \param joystick Index of the joystick +/// \param axis Axis to check +/// +/// \return sfTrue if the joystick supports the axis, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis); + +//////////////////////////////////////////////////////////// +/// \brief Check if a joystick button is pressed +/// +/// If the joystick is not connected, this function returns false. +/// +/// \param joystick Index of the joystick +/// \param button Button to check +/// +/// \return sfTrue if the button is pressed, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button); + +//////////////////////////////////////////////////////////// +/// \brief Get the current position of a joystick axis +/// +/// If the joystick is not connected, this function returns 0. +/// +/// \param joystick Index of the joystick +/// \param axis Axis to check +/// +/// \return Current position of the axis, in range [-100 .. 100] +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis); + +//////////////////////////////////////////////////////////// +/// \brief Update the states of all joysticks +/// +/// This function is used internally by SFML, so you normally +/// don't have to call it explicitely. However, you may need to +/// call it if you have no window yet (or no window at all): +/// in this case the joysticks states are not updated automatically. +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfJoystick_update(void); + + +#endif // SFML_JOYSTICK_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Keyboard.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Keyboard.h new file mode 100755 index 0000000..c8951e2 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Keyboard.h @@ -0,0 +1,157 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_KEYBOARD_H +#define SFML_KEYBOARD_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> + + +//////////////////////////////////////////////////////////// +/// \brief Key codes +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfKeyUnknown = -1, ///< Unhandled key + sfKeyA, ///< The A key + sfKeyB, ///< The B key + sfKeyC, ///< The C key + sfKeyD, ///< The D key + sfKeyE, ///< The E key + sfKeyF, ///< The F key + sfKeyG, ///< The G key + sfKeyH, ///< The H key + sfKeyI, ///< The I key + sfKeyJ, ///< The J key + sfKeyK, ///< The K key + sfKeyL, ///< The L key + sfKeyM, ///< The M key + sfKeyN, ///< The N key + sfKeyO, ///< The O key + sfKeyP, ///< The P key + sfKeyQ, ///< The Q key + sfKeyR, ///< The R key + sfKeyS, ///< The S key + sfKeyT, ///< The T key + sfKeyU, ///< The U key + sfKeyV, ///< The V key + sfKeyW, ///< The W key + sfKeyX, ///< The X key + sfKeyY, ///< The Y key + sfKeyZ, ///< The Z key + sfKeyNum0, ///< The 0 key + sfKeyNum1, ///< The 1 key + sfKeyNum2, ///< The 2 key + sfKeyNum3, ///< The 3 key + sfKeyNum4, ///< The 4 key + sfKeyNum5, ///< The 5 key + sfKeyNum6, ///< The 6 key + sfKeyNum7, ///< The 7 key + sfKeyNum8, ///< The 8 key + sfKeyNum9, ///< The 9 key + sfKeyEscape, ///< The Escape key + sfKeyLControl, ///< The left Control key + sfKeyLShift, ///< The left Shift key + sfKeyLAlt, ///< The left Alt key + sfKeyLSystem, ///< The left OS specific key: window (Windows and Linux), apple (MacOS X), ... + sfKeyRControl, ///< The right Control key + sfKeyRShift, ///< The right Shift key + sfKeyRAlt, ///< The right Alt key + sfKeyRSystem, ///< The right OS specific key: window (Windows and Linux), apple (MacOS X), ... + sfKeyMenu, ///< The Menu key + sfKeyLBracket, ///< The [ key + sfKeyRBracket, ///< The ] key + sfKeySemiColon, ///< The ; key + sfKeyComma, ///< The , key + sfKeyPeriod, ///< The . key + sfKeyQuote, ///< The ' key + sfKeySlash, ///< The / key + sfKeyBackSlash, ///< The \ key + sfKeyTilde, ///< The ~ key + sfKeyEqual, ///< The = key + sfKeyDash, ///< The - key + sfKeySpace, ///< The Space key + sfKeyReturn, ///< The Return key + sfKeyBack, ///< The Backspace key + sfKeyTab, ///< The Tabulation key + sfKeyPageUp, ///< The Page up key + sfKeyPageDown, ///< The Page down key + sfKeyEnd, ///< The End key + sfKeyHome, ///< The Home key + sfKeyInsert, ///< The Insert key + sfKeyDelete, ///< The Delete key + sfKeyAdd, ///< + + sfKeySubtract, ///< - + sfKeyMultiply, ///< * + sfKeyDivide, ///< / + sfKeyLeft, ///< Left arrow + sfKeyRight, ///< Right arrow + sfKeyUp, ///< Up arrow + sfKeyDown, ///< Down arrow + sfKeyNumpad0, ///< The numpad 0 key + sfKeyNumpad1, ///< The numpad 1 key + sfKeyNumpad2, ///< The numpad 2 key + sfKeyNumpad3, ///< The numpad 3 key + sfKeyNumpad4, ///< The numpad 4 key + sfKeyNumpad5, ///< The numpad 5 key + sfKeyNumpad6, ///< The numpad 6 key + sfKeyNumpad7, ///< The numpad 7 key + sfKeyNumpad8, ///< The numpad 8 key + sfKeyNumpad9, ///< The numpad 9 key + sfKeyF1, ///< The F1 key + sfKeyF2, ///< The F2 key + sfKeyF3, ///< The F3 key + sfKeyF4, ///< The F4 key + sfKeyF5, ///< The F5 key + sfKeyF6, ///< The F6 key + sfKeyF7, ///< The F7 key + sfKeyF8, ///< The F8 key + sfKeyF9, ///< The F8 key + sfKeyF10, ///< The F10 key + sfKeyF11, ///< The F11 key + sfKeyF12, ///< The F12 key + sfKeyF13, ///< The F13 key + sfKeyF14, ///< The F14 key + sfKeyF15, ///< The F15 key + sfKeyPause, ///< The Pause key + + sfKeyCount ///< Keep last -- the total number of keyboard keys +} sfKeyCode; + + +//////////////////////////////////////////////////////////// +/// \brief Check if a key is pressed +/// +/// \param key Key to check +/// +/// \return sfTrue if the key is pressed, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key); + + +#endif // SFML_KEYBOARD_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Mouse.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Mouse.h new file mode 100755 index 0000000..a1c1ce7 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Mouse.h @@ -0,0 +1,87 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_MOUSE_H +#define SFML_MOUSE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> +#include <SFML/Window/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Mouse buttons +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfMouseLeft, ///< The left mouse button + sfMouseRight, ///< The right mouse button + sfMouseMiddle, ///< The middle (wheel) mouse button + sfMouseXButton1, ///< The first extra mouse button + sfMouseXButton2, ///< The second extra mouse button + + sfMouseButtonCount ///< Keep last -- the total number of mouse buttons +} sfMouseButton; + + +//////////////////////////////////////////////////////////// +/// \brief Check if a mouse button is pressed +/// +/// \param button Button to check +/// +/// \return sfTrue if the button is pressed, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfMouse_isButtonPressed(sfMouseButton button); + +//////////////////////////////////////////////////////////// +/// \brief Get the current position of the mouse +/// +/// This function returns the current position of the mouse +/// cursor relative to the given window, or desktop if NULL is passed. +/// +/// \param relativeTo Reference window +/// +/// \return Position of the mouse cursor, relative to the given window +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfVector2i sfMouse_getPosition(const sfWindow* relativeTo); + +//////////////////////////////////////////////////////////// +/// \brief Set the current position of the mouse +/// +/// This function sets the current position of the mouse +/// cursor relative to the given window, or desktop if NULL is passed. +/// +/// \param position New position of the mouse +/// \param relativeTo Reference window +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfMouse_setPosition(sfVector2i position, const sfWindow* relativeTo); + + +#endif // SFML_MOUSE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Types.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Types.h new file mode 100755 index 0000000..bc4b3a0 --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Types.h @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_WINDOW_TYPES_H +#define SFML_WINDOW_TYPES_H + + +typedef struct sfContext sfContext; +typedef struct sfWindow sfWindow; + + +#endif // SFML_WINDOW_TYPES_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/VideoMode.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/VideoMode.h new file mode 100755 index 0000000..5d5bc6a --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/VideoMode.h @@ -0,0 +1,89 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_VIDEOMODE_H +#define SFML_VIDEOMODE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> +#include <stddef.h> + + +//////////////////////////////////////////////////////////// +/// \brief sfVideoMode defines a video mode (width, height, bpp, frequency) +/// and provides functions for getting modes supported +/// by the display device +/// +//////////////////////////////////////////////////////////// +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 +} sfVideoMode; + + +//////////////////////////////////////////////////////////// +/// \brief Get the current desktop video mode +/// +/// \return Current desktop video mode +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode(void); + +//////////////////////////////////////////////////////////// +/// \brief Retrieve all the video modes supported in fullscreen mode +/// +/// When creating a fullscreen window, the video mode is restricted +/// to be compatible with what the graphics driver and monitor +/// support. This function returns the complete list of all video +/// modes that can be used in fullscreen mode. +/// The returned array is sorted from best to worst, so that +/// the first element will always give the best mode (higher +/// width, height and bits-per-pixel). +/// +/// \param count Pointer to a variable that will be filled with the number of modes in the array +/// +/// \return Pointer to an array containing all the supported fullscreen modes +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not a video mode is valid +/// +/// The validity of video modes is only relevant when using +/// fullscreen windows; otherwise any video mode can be used +/// with no restriction. +/// +/// \param mode Video mode +/// +/// \return sfTrue if the video mode is valid for fullscreen mode +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfVideoMode_isValid(sfVideoMode mode); + + +#endif // SFML_VIDEOMODE_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Window.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Window.h new file mode 100755 index 0000000..624bd6d --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/Window.h @@ -0,0 +1,416 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_WINDOW_H +#define SFML_WINDOW_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> +#include <SFML/Window/Event.h> +#include <SFML/Window/VideoMode.h> +#include <SFML/Window/WindowHandle.h> +#include <SFML/Window/Types.h> +#include <SFML/System/Vector2.h> + + +//////////////////////////////////////////////////////////// +/// \brief Enumeration of window creation styles +/// +//////////////////////////////////////////////////////////// +enum +{ + sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive) + sfTitlebar = 1 << 0, ///< Title bar + fixed border + sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button + sfClose = 1 << 2, ///< Titlebar + close button + sfFullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive) + sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style +}; + + +//////////////////////////////////////////////////////////// +/// \brief Structure defining the window's creation settings +/// +//////////////////////////////////////////////////////////// +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 +} sfContextSettings; + + +//////////////////////////////////////////////////////////// +/// \brief Construct a new window +/// +/// This function creates the window with the size and pixel +/// depth defined in \a mode. An optional style can be passed to +/// customize the look and behaviour of the window (borders, +/// title bar, resizable, closable, ...). If \a style contains +/// sfFullscreen, then \a mode must be a valid video mode. +/// +/// The fourth parameter is a pointer to a structure specifying +/// advanced OpenGL context settings such as antialiasing, +/// depth-buffer bits, etc. +/// +/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) +/// \param title Title of the window +/// \param style Window style +/// \param settings Additional settings for the underlying OpenGL context +/// +/// \return A new sfWindow object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings); + +//////////////////////////////////////////////////////////// +/// \brief Construct a new window (with a UTF-32 title) +/// +/// This function creates the window with the size and pixel +/// depth defined in \a mode. An optional style can be passed to +/// customize the look and behaviour of the window (borders, +/// title bar, resizable, closable, ...). If \a style contains +/// sfFullscreen, then \a mode must be a valid video mode. +/// +/// The fourth parameter is a pointer to a structure specifying +/// advanced OpenGL context settings such as antialiasing, +/// depth-buffer bits, etc. +/// +/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) +/// \param title Title of the window (UTF-32) +/// \param style Window style +/// \param settings Additional settings for the underlying OpenGL context +/// +/// \return A new sfWindow object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings); + +//////////////////////////////////////////////////////////// +/// \brief Construct a window from an existing control +/// +/// Use this constructor if you want to create an OpenGL +/// rendering area into an already existing control. +/// +/// The second parameter is a pointer to a structure specifying +/// advanced OpenGL context settings such as antialiasing, +/// depth-buffer bits, etc. +/// +/// \param handle Platform-specific handle of the control +/// \param settings Additional settings for the underlying OpenGL context +/// +/// \return A new sfWindow object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings); + +//////////////////////////////////////////////////////////// +/// \brief Destroy a window +/// +/// \param window Window to destroy +/// +//////////////////////////////////////////////////////////// +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 +/// every time), and will have no effect on closed windows. +/// +/// \param window Window object +/// +//////////////////////////////////////////////////////////// +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_setVisible(sfFalse)) will return +/// sfTrue. +/// +/// \param window Window object +/// +/// \return sfTrue if the window is opened, sfFalse if it has been closed +/// +//////////////////////////////////////////////////////////// +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, +/// if one or more settings were not supported. In this case, +/// SFML chose the closest match. +/// +/// \param window Window object +/// +/// \return Structure containing the OpenGL context settings +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window); + +//////////////////////////////////////////////////////////// +/// \brief Pop the event on top of event queue, if any, and return it +/// +/// This function is not blocking: if there's no pending event then +/// it will return false and leave \a event unmodified. +/// Note that more than one event may be present in the event queue, +/// thus you should always call this function in a loop +/// to make sure that you process every pending event. +/// +/// \param window Window object +/// \param event Event to be returned +/// +/// \return sfTrue if an event was returned, or sfFalse if the event queue was empty +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event); + +//////////////////////////////////////////////////////////// +/// \brief Wait for an event and return it +/// +/// This function is blocking: if there's no pending event then +/// it will wait until an event is received. +/// After this function returns (and no error occured), +/// the \a event object is always valid and filled properly. +/// This function is typically used when you have a thread that +/// is dedicated to events handling: you want to make this thread +/// sleep as long as no new event is received. +/// +/// \param window Window object +/// \param event Event to be returned +/// +/// \return sfFalse if any error occured +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event); + +//////////////////////////////////////////////////////////// +/// \brief Get the position of a window +/// +/// \param window Window object +/// +/// \return Position in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfVector2i sfWindow_getPosition(const sfWindow* window); + +//////////////////////////////////////////////////////////// +/// \brief Change the position of a window on screen +/// +/// This function only works for top-level windows +/// (i.e. it will be ignored for windows created from +/// the handle of a child window/control). +/// +/// \param window Window object +/// \param position New position of the window, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setPosition(sfWindow* window, sfVector2i position); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of the rendering region of a window +/// +/// The size doesn't include the titlebar and borders +/// of the window. +/// +/// \param window Window object +/// +/// \return Size in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfVector2u sfWindow_getSize(const sfWindow* window); + +//////////////////////////////////////////////////////////// +/// \brief Change the size of the rendering region of a window +/// +/// \param window Window object +/// \param size New size, in pixels +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setSize(sfWindow* window, sfVector2u size); + +//////////////////////////////////////////////////////////// +/// \brief Change the title of a window +/// +/// \param window Window object +/// \param title New title +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title); + +//////////////////////////////////////////////////////////// +/// \brief Change the title of a window (with a UTF-32 string) +/// +/// \param window Window object +/// \param title New title +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32* title); + +//////////////////////////////////////////////////////////// +/// \brief Change a window's icon +/// +/// \a pixels must be an array of \a width x \a height pixels +/// in 32-bits RGBA format. +/// +/// \param window Window object +/// \param width Icon's width, in pixels +/// \param height Icon's height, in pixels +/// \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); + +//////////////////////////////////////////////////////////// +/// \brief Show or hide a window +/// +/// \param window Window object +/// \param visible sfTrue to show the window, sfFalse to hide it +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible); + +//////////////////////////////////////////////////////////// +/// \brief Show or hide the mouse cursor +/// +/// \param window Window object +/// \param visible sfTrue to show, sfFalse to hide +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable vertical synchronization +/// +/// Activating vertical synchronization will limit the number +/// of frames displayed to the refresh rate of the monitor. +/// This can avoid some visual artifacts, and limit the framerate +/// to a good value (but not constant across different computers). +/// +/// \param window Window object +/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled); + +//////////////////////////////////////////////////////////// +/// \brief Enable or disable automatic key-repeat +/// +/// If key repeat is enabled, you will receive repeated +/// KeyPress events while keeping a key pressed. If it is disabled, +/// you will only get a single event when the key is pressed. +/// +/// Key repeat is enabled by default. +/// +/// \param window Window object +/// \param enabled sfTrue to enable, sfFalse to disable +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled); + +//////////////////////////////////////////////////////////// +/// \brief Activate or deactivate a window as the current target +/// for OpenGL rendering +/// +/// A window is active only on the current thread, if you want to +/// make it active on another thread you have to deactivate it +/// on the previous thread first if it was active. +/// Only one window can be active on a thread at a time, thus +/// the window previously active (if any) automatically gets deactivated. +/// +/// \param window Window object +/// \param active sfTrue to activate, sfFalse to deactivate +/// +/// \return sfTrue if operation was successful, sfFalse otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active); + +//////////////////////////////////////////////////////////// +/// \brief Display on screen what has been rendered to the +/// window so far +/// +/// This function is typically called after all OpenGL rendering +/// has been done for the current frame, in order to show +/// it on screen. +/// +/// \param window Window object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_display(sfWindow* window); + +//////////////////////////////////////////////////////////// +/// \brief Limit the framerate to a maximum fixed frequency +/// +/// If a limit is set, the window will use a small delay after +/// each call to sfWindow_display to ensure that the current frame +/// lasted long enough to match the framerate limit. +/// +/// \param window Window object +/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit) +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit); + +//////////////////////////////////////////////////////////// +/// \brief Change the joystick threshold +/// +/// The joystick threshold is the value below which +/// no JoyMoved event will be generated. +/// +/// \param window Window object +/// \param threshold New threshold, in the range [0, 100] +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold); + +//////////////////////////////////////////////////////////// +/// \brief Get the OS-specific handle of the window +/// +/// The type of the returned handle is sfWindowHandle, +/// which is a typedef to the handle type defined by the OS. +/// You shouldn't need to use this function, unless you have +/// very specific stuff to implement that SFML doesn't support, +/// or implement a temporary workaround until a bug is fixed. +/// +/// \param window Window object +/// +/// \return System handle of the window +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window); + + +#endif // SFML_WINDOW_H diff --git a/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/WindowHandle.h b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/WindowHandle.h new file mode 100755 index 0000000..89319cb --- /dev/null +++ b/libghack/CSFML-2.1-windows-32bits/CSFML-2.1/include/SFML/Window/WindowHandle.h @@ -0,0 +1,57 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef SFML_WINDOWHANDLE_H +#define SFML_WINDOWHANDLE_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <SFML/Window/Export.h> + + +//////////////////////////////////////////////////////////// +/// Define a low-level window handle type, specific to +/// each platform +//////////////////////////////////////////////////////////// +#if defined(CSFML_SYSTEM_WINDOWS) + + // Window handle is HWND (HWND__*) on Windows + struct HWND__; + typedef struct HWND__* sfWindowHandle; + +#elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD) + + // Window handle is Window (unsigned long) on Unix - X11 + typedef unsigned long sfWindowHandle; + +#elif defined(CSFML_SYSTEM_MACOS) + + // Window handle is NSWindow (void*) on Mac OS X - Cocoa + typedef void* sfWindowHandle; + +#endif + + +#endif // SFML_WINDOWHANDLE_H |