mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 13:06:13 +01:00
Updated to the new naming convention
This commit is contained in:
1 parent
9d0d0588b2
commit
36904a45d9
99 files changed
+2409
-2369
No files matched your search
+12
-12
@@ -31,46 +31,46 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfListener_SetGlobalVolume(float volume)
|
||||
void sfListener_setGlobalVolume(float volume)
|
||||
{
|
||||
sf::Listener::SetGlobalVolume(volume);
|
||||
sf::Listener::setGlobalVolume(volume);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfListener_GetGlobalVolume(void)
|
||||
float sfListener_getGlobalVolume(void)
|
||||
{
|
||||
return sf::Listener::GetGlobalVolume();
|
||||
return sf::Listener::getGlobalVolume();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfListener_SetPosition(sfVector3f position)
|
||||
void sfListener_setPosition(sfVector3f position)
|
||||
{
|
||||
sf::Listener::SetPosition(position.x, position.y, position.z);
|
||||
sf::Listener::setPosition(position.x, position.y, position.z);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector3f sfListener_GetPosition()
|
||||
sfVector3f sfListener_getPosition()
|
||||
{
|
||||
sf::Vector3f sfmlPos = sf::Listener::GetPosition();
|
||||
sf::Vector3f sfmlPos = sf::Listener::getPosition();
|
||||
sfVector3f position = {sfmlPos.x, sfmlPos.y, sfmlPos.z};
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfListener_SetDirection(sfVector3f direction)
|
||||
void sfListener_setDirection(sfVector3f direction)
|
||||
{
|
||||
sf::Listener::SetDirection(direction.x, direction.y, direction.z);
|
||||
sf::Listener::setDirection(direction.x, direction.y, direction.z);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector3f sfListener_GetDirection()
|
||||
sfVector3f sfListener_getDirection()
|
||||
{
|
||||
sf::Vector3f sfmlDirection = sf::Listener::GetDirection();
|
||||
sf::Vector3f sfmlDirection = sf::Listener::getDirection();
|
||||
sfVector3f direction = {sfmlDirection.x, sfmlDirection.y, sfmlDirection.z};
|
||||
return direction;
|
||||
}
|
||||
+53
-53
@@ -31,10 +31,10 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfMusic* sfMusic_CreateFromFile(const char* filename)
|
||||
sfMusic* sfMusic_createFromFile(const char* filename)
|
||||
{
|
||||
sfMusic* music = new sfMusic;
|
||||
if (!music->This.OpenFromFile(filename))
|
||||
if (!music->This.openFromFile(filename))
|
||||
{
|
||||
delete music;
|
||||
music = NULL;
|
||||
@@ -45,10 +45,10 @@ sfMusic* sfMusic_CreateFromFile(const char* filename)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
sfMusic* sfMusic_createFromMemory(const void* data, size_t sizeInBytes)
|
||||
{
|
||||
sfMusic* music = new sfMusic;
|
||||
if (!music->This.OpenFromMemory(data, sizeInBytes))
|
||||
if (!music->This.openFromMemory(data, sizeInBytes))
|
||||
{
|
||||
delete music;
|
||||
music = NULL;
|
||||
@@ -59,13 +59,13 @@ sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfMusic* sfMusic_CreateFromStream(sfInputStream* stream)
|
||||
sfMusic* sfMusic_createFromStream(sfInputStream* stream)
|
||||
{
|
||||
CSFML_CHECK_RETURN(stream, NULL);
|
||||
|
||||
sfMusic* music = new sfMusic;
|
||||
music->Stream = CallbackStream(stream);
|
||||
if (!music->This.OpenFromStream(music->Stream))
|
||||
if (!music->This.openFromStream(music->Stream))
|
||||
{
|
||||
delete music;
|
||||
music = NULL;
|
||||
@@ -76,162 +76,162 @@ sfMusic* sfMusic_CreateFromStream(sfInputStream* stream)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_Destroy(sfMusic* music)
|
||||
void sfMusic_destroy(sfMusic* music)
|
||||
{
|
||||
delete music;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetLoop(sfMusic* music, sfBool loop)
|
||||
void sfMusic_setLoop(sfMusic* music, sfBool loop)
|
||||
{
|
||||
CSFML_CALL(music, SetLoop(loop != 0));
|
||||
CSFML_CALL(music, setLoop(loop != 0));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfMusic_GetLoop(const sfMusic* music)
|
||||
sfBool sfMusic_getLoop(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetLoop(), sfFalse);
|
||||
CSFML_CALL_RETURN(music, getLoop(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfMusic_GetDuration(const sfMusic* music)
|
||||
sfTime sfMusic_getDuration(const sfMusic* music)
|
||||
{
|
||||
sfTime time = {0};
|
||||
CSFML_CHECK_RETURN(music, time);
|
||||
|
||||
time.Microseconds = music->This.GetDuration().AsMicroseconds();
|
||||
time.microseconds = music->This.getDuration().asMicroseconds();
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_Play(sfMusic* music)
|
||||
void sfMusic_play(sfMusic* music)
|
||||
{
|
||||
CSFML_CALL(music, Play());
|
||||
CSFML_CALL(music, play());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_Pause(sfMusic* music)
|
||||
void sfMusic_pause(sfMusic* music)
|
||||
{
|
||||
CSFML_CALL(music, Pause());
|
||||
CSFML_CALL(music, pause());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_Stop(sfMusic* music)
|
||||
void sfMusic_stop(sfMusic* music)
|
||||
{
|
||||
CSFML_CALL(music, Stop());
|
||||
CSFML_CALL(music, stop());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfMusic_GetChannelCount(const sfMusic* music)
|
||||
unsigned int sfMusic_getChannelCount(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetChannelCount(), 0);
|
||||
CSFML_CALL_RETURN(music, getChannelCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfMusic_GetSampleRate(const sfMusic* music)
|
||||
unsigned int sfMusic_getSampleRate(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetSampleRate(), 0);
|
||||
CSFML_CALL_RETURN(music, getSampleRate(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundStatus sfMusic_GetStatus(const sfMusic* music)
|
||||
sfSoundStatus sfMusic_getStatus(const sfMusic* music)
|
||||
{
|
||||
CSFML_CHECK_RETURN(music, sfStopped);
|
||||
|
||||
return static_cast<sfSoundStatus>(music->This.GetStatus());
|
||||
return static_cast<sfSoundStatus>(music->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfMusic_GetPlayingOffset(const sfMusic* music)
|
||||
sfTime sfMusic_getPlayingOffset(const sfMusic* music)
|
||||
{
|
||||
sfTime time = {0};
|
||||
CSFML_CHECK_RETURN(music, time);
|
||||
|
||||
time.Microseconds = music->This.GetPlayingOffset().AsMicroseconds();
|
||||
time.microseconds = music->This.getPlayingOffset().asMicroseconds();
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetPitch(sfMusic* music, float pitch)
|
||||
void sfMusic_setPitch(sfMusic* music, float pitch)
|
||||
{
|
||||
CSFML_CALL(music, SetPitch(pitch));
|
||||
CSFML_CALL(music, setPitch(pitch));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetVolume(sfMusic* music, float volume)
|
||||
void sfMusic_setVolume(sfMusic* music, float volume)
|
||||
{
|
||||
CSFML_CALL(music, SetVolume(volume));
|
||||
CSFML_CALL(music, setVolume(volume));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetPosition(sfMusic* music, sfVector3f position)
|
||||
void sfMusic_setPosition(sfMusic* music, sfVector3f position)
|
||||
{
|
||||
CSFML_CALL(music, SetPosition(sf::Vector3f(position.x, position.y, position.z)));
|
||||
CSFML_CALL(music, setPosition(sf::Vector3f(position.x, position.y, position.z)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relative)
|
||||
void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative)
|
||||
{
|
||||
CSFML_CALL(music, SetRelativeToListener(relative == sfTrue));
|
||||
CSFML_CALL(music, setRelativeToListener(relative == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetMinDistance(sfMusic* music, float distance)
|
||||
void sfMusic_setMinDistance(sfMusic* music, float distance)
|
||||
{
|
||||
CSFML_CALL(music, SetMinDistance(distance));
|
||||
CSFML_CALL(music, setMinDistance(distance));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetAttenuation(sfMusic* music, float attenuation)
|
||||
void sfMusic_setAttenuation(sfMusic* music, float attenuation)
|
||||
{
|
||||
CSFML_CALL(music, SetAttenuation(attenuation));
|
||||
CSFML_CALL(music, setAttenuation(attenuation));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_SetPlayingOffset(sfMusic* music, sfTime timeOffset)
|
||||
void sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset)
|
||||
{
|
||||
CSFML_CALL(music, SetPlayingOffset(sf::Microseconds(timeOffset.Microseconds)));
|
||||
CSFML_CALL(music, setPlayingOffset(sf::microseconds(timeOffset.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfMusic_GetPitch(const sfMusic* music)
|
||||
float sfMusic_getPitch(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetPitch(), 0.f);
|
||||
CSFML_CALL_RETURN(music, getPitch(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfMusic_GetVolume(const sfMusic* music)
|
||||
float sfMusic_getVolume(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetVolume(), 0.f);
|
||||
CSFML_CALL_RETURN(music, getVolume(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector3f sfMusic_GetPosition(const sfMusic* music)
|
||||
sfVector3f sfMusic_getPosition(const sfMusic* music)
|
||||
{
|
||||
sfVector3f position = {0, 0, 0};
|
||||
CSFML_CHECK_RETURN(music, position);
|
||||
|
||||
sf::Vector3f sfmlPos = music->This.GetPosition();
|
||||
sf::Vector3f sfmlPos = music->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
position.z = sfmlPos.z;
|
||||
@@ -241,21 +241,21 @@ sfVector3f sfMusic_GetPosition(const sfMusic* music)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music)
|
||||
sfBool sfMusic_isRelativeToListener(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, IsRelativeToListener(), sfFalse);
|
||||
CSFML_CALL_RETURN(music, isRelativeToListener(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfMusic_GetMinDistance(const sfMusic* music)
|
||||
float sfMusic_getMinDistance(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetMinDistance(), 0.f);
|
||||
CSFML_CALL_RETURN(music, getMinDistance(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfMusic_GetAttenuation(const sfMusic* music)
|
||||
float sfMusic_getAttenuation(const sfMusic* music)
|
||||
{
|
||||
CSFML_CALL_RETURN(music, GetAttenuation(), 0.f);
|
||||
CSFML_CALL_RETURN(music, getAttenuation(), 0.f);
|
||||
}
|
||||
+46
-46
@@ -31,14 +31,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSound* sfSound_Create(void)
|
||||
sfSound* sfSound_create(void)
|
||||
{
|
||||
return new sfSound;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSound* sfSound_Copy(sfSound* sound)
|
||||
sfSound* sfSound_copy(sfSound* sound)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sound, NULL);
|
||||
|
||||
@@ -47,46 +47,46 @@ sfSound* sfSound_Copy(sfSound* sound)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_Destroy(sfSound* sound)
|
||||
void sfSound_destroy(sfSound* sound)
|
||||
{
|
||||
delete sound;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_Play(sfSound* sound)
|
||||
void sfSound_play(sfSound* sound)
|
||||
{
|
||||
CSFML_CALL(sound, Play());
|
||||
CSFML_CALL(sound, play());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_Pause(sfSound* sound)
|
||||
void sfSound_pause(sfSound* sound)
|
||||
{
|
||||
CSFML_CALL(sound, Pause());
|
||||
CSFML_CALL(sound, pause());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_Stop(sfSound* sound)
|
||||
void sfSound_stop(sfSound* sound)
|
||||
{
|
||||
CSFML_CALL(sound, Stop());
|
||||
CSFML_CALL(sound, stop());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buffer)
|
||||
void sfSound_setBuffer(sfSound* sound, const sfSoundBuffer* buffer)
|
||||
{
|
||||
if (buffer)
|
||||
{
|
||||
CSFML_CALL(sound, SetBuffer(buffer->This));
|
||||
CSFML_CALL(sound, setBuffer(buffer->This));
|
||||
sound->Buffer = buffer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound)
|
||||
const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sound, NULL);
|
||||
|
||||
@@ -95,98 +95,98 @@ const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetLoop(sfSound* sound, sfBool loop)
|
||||
void sfSound_setLoop(sfSound* sound, sfBool loop)
|
||||
{
|
||||
CSFML_CALL(sound, SetLoop(loop == sfTrue));
|
||||
CSFML_CALL(sound, setLoop(loop == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSound_GetLoop(const sfSound* sound)
|
||||
sfBool sfSound_getLoop(const sfSound* sound)
|
||||
{
|
||||
CSFML_CALL_RETURN(sound, GetLoop(), sfFalse);
|
||||
CSFML_CALL_RETURN(sound, getLoop(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundStatus sfSound_GetStatus(const sfSound* sound)
|
||||
sfSoundStatus sfSound_getStatus(const sfSound* sound)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sound, sfStopped);
|
||||
|
||||
return static_cast<sfSoundStatus>(sound->This.GetStatus());
|
||||
return static_cast<sfSoundStatus>(sound->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetPitch(sfSound* sound, float pitch)
|
||||
void sfSound_setPitch(sfSound* sound, float pitch)
|
||||
{
|
||||
CSFML_CALL(sound, SetPitch(pitch));
|
||||
CSFML_CALL(sound, setPitch(pitch));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetVolume(sfSound* sound, float volume)
|
||||
void sfSound_setVolume(sfSound* sound, float volume)
|
||||
{
|
||||
CSFML_CALL(sound, SetVolume(volume));
|
||||
CSFML_CALL(sound, setVolume(volume));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetPosition(sfSound* sound, sfVector3f position)
|
||||
void sfSound_setPosition(sfSound* sound, sfVector3f position)
|
||||
{
|
||||
CSFML_CALL(sound, SetPosition(sf::Vector3f(position.x, position.y, position.z)));
|
||||
CSFML_CALL(sound, setPosition(sf::Vector3f(position.x, position.y, position.z)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetRelativeToListener(sfSound* sound, sfBool relative)
|
||||
void sfSound_setRelativeToListener(sfSound* sound, sfBool relative)
|
||||
{
|
||||
CSFML_CALL(sound, SetRelativeToListener(relative == sfTrue));
|
||||
CSFML_CALL(sound, setRelativeToListener(relative == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetMinDistance(sfSound* sound, float distance)
|
||||
void sfSound_setMinDistance(sfSound* sound, float distance)
|
||||
{
|
||||
CSFML_CALL(sound, SetMinDistance(distance));
|
||||
CSFML_CALL(sound, setMinDistance(distance));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetAttenuation(sfSound* sound, float attenuation)
|
||||
void sfSound_setAttenuation(sfSound* sound, float attenuation)
|
||||
{
|
||||
CSFML_CALL(sound, SetAttenuation(attenuation));
|
||||
CSFML_CALL(sound, setAttenuation(attenuation));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSound_SetPlayingOffset(sfSound* sound, sfTime timeOffset)
|
||||
void sfSound_setPlayingOffset(sfSound* sound, sfTime timeOffset)
|
||||
{
|
||||
CSFML_CALL(sound, SetPlayingOffset(sf::Microseconds(timeOffset.Microseconds)));
|
||||
CSFML_CALL(sound, setPlayingOffset(sf::microseconds(timeOffset.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSound_GetPitch(const sfSound* sound)
|
||||
float sfSound_getPitch(const sfSound* sound)
|
||||
{
|
||||
CSFML_CALL_RETURN(sound, GetPitch(), 0.f);
|
||||
CSFML_CALL_RETURN(sound, getPitch(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSound_GetVolume(const sfSound* sound)
|
||||
float sfSound_getVolume(const sfSound* sound)
|
||||
{
|
||||
CSFML_CALL_RETURN(sound, GetVolume(), 0.f);
|
||||
CSFML_CALL_RETURN(sound, getVolume(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector3f sfSound_GetPosition(const sfSound* sound)
|
||||
sfVector3f sfSound_getPosition(const sfSound* sound)
|
||||
{
|
||||
sfVector3f position = {0, 0, 0};
|
||||
CSFML_CHECK_RETURN(sound, position);
|
||||
|
||||
sf::Vector3f sfmlPos = sound->This.GetPosition();
|
||||
sf::Vector3f sfmlPos = sound->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
position.z = sfmlPos.z;
|
||||
@@ -196,32 +196,32 @@ sfVector3f sfSound_GetPosition(const sfSound* sound)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfBool sfSound_IsRelativeToListener(const sfSound* sound)
|
||||
CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound)
|
||||
{
|
||||
CSFML_CALL_RETURN(sound, IsRelativeToListener(), sfFalse);
|
||||
CSFML_CALL_RETURN(sound, isRelativeToListener(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSound_GetMinDistance(const sfSound* sound)
|
||||
float sfSound_getMinDistance(const sfSound* sound)
|
||||
{
|
||||
CSFML_CALL_RETURN(sound, GetMinDistance(), 0.f);
|
||||
CSFML_CALL_RETURN(sound, getMinDistance(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSound_GetAttenuation(const sfSound* sound)
|
||||
float sfSound_getAttenuation(const sfSound* sound)
|
||||
{
|
||||
CSFML_CALL_RETURN(sound, GetAttenuation(), 0.f);
|
||||
CSFML_CALL_RETURN(sound, getAttenuation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfSound_GetPlayingOffset(const sfSound* sound)
|
||||
sfTime sfSound_getPlayingOffset(const sfSound* sound)
|
||||
{
|
||||
sfTime time = {0};
|
||||
CSFML_CHECK_RETURN(sound, time);
|
||||
|
||||
time.Microseconds = sound->This.GetPlayingOffset().AsMicroseconds();
|
||||
time.microseconds = sound->This.getPlayingOffset().asMicroseconds();
|
||||
return time;
|
||||
}
|
||||
@@ -32,11 +32,11 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename)
|
||||
sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename)
|
||||
{
|
||||
sfSoundBuffer* buffer = new sfSoundBuffer;
|
||||
|
||||
if (!buffer->This.LoadFromFile(filename))
|
||||
if (!buffer->This.loadFromFile(filename))
|
||||
{
|
||||
delete buffer;
|
||||
buffer = NULL;
|
||||
@@ -47,11 +47,11 @@ sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInBytes)
|
||||
{
|
||||
sfSoundBuffer* buffer = new sfSoundBuffer;
|
||||
|
||||
if (!buffer->This.LoadFromMemory(data, sizeInBytes))
|
||||
if (!buffer->This.loadFromMemory(data, sizeInBytes))
|
||||
{
|
||||
delete buffer;
|
||||
buffer = NULL;
|
||||
@@ -63,13 +63,13 @@ sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInByt
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* stream)
|
||||
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
|
||||
{
|
||||
CSFML_CHECK_RETURN(stream, NULL);
|
||||
|
||||
sfSoundBuffer* buffer = new sfSoundBuffer;
|
||||
CallbackStream sfmlStream(stream);
|
||||
if (!buffer->This.LoadFromStream(sfmlStream))
|
||||
if (!buffer->This.loadFromStream(sfmlStream))
|
||||
{
|
||||
delete buffer;
|
||||
buffer = NULL;
|
||||
@@ -80,11 +80,11 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* str
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelsCount, unsigned int sampleRate)
|
||||
sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
|
||||
{
|
||||
sfSoundBuffer* buffer = new sfSoundBuffer;
|
||||
|
||||
if (!buffer->This.LoadFromSamples(samples, sampleCount, channelsCount, sampleRate))
|
||||
if (!buffer->This.loadFromSamples(samples, sampleCount, channelCount, sampleRate))
|
||||
{
|
||||
delete buffer;
|
||||
buffer = NULL;
|
||||
@@ -95,7 +95,7 @@ sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sa
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer)
|
||||
sfSoundBuffer* sfSoundBuffer_copy(sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
CSFML_CHECK_RETURN(soundBuffer, NULL);
|
||||
|
||||
@@ -104,53 +104,53 @@ sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer)
|
||||
void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
delete soundBuffer;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
|
||||
sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBuffer, SaveToFile(filename), sfFalse);
|
||||
CSFML_CALL_RETURN(soundBuffer, saveToFile(filename), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer)
|
||||
const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBuffer, GetSamples(), NULL);
|
||||
CSFML_CALL_RETURN(soundBuffer, getSamples(), NULL);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
size_t sfSoundBuffer_GetSampleCount(const sfSoundBuffer* soundBuffer)
|
||||
size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBuffer, GetSampleCount(), 0);
|
||||
CSFML_CALL_RETURN(soundBuffer, getSampleCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer)
|
||||
unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBuffer, GetSampleRate(), 0);
|
||||
CSFML_CALL_RETURN(soundBuffer, getSampleRate(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundBuffer_GetChannelCount(const sfSoundBuffer* soundBuffer)
|
||||
unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBuffer, GetChannelCount(), 0);
|
||||
CSFML_CALL_RETURN(soundBuffer, getChannelCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer)
|
||||
sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
sfTime time = {0};
|
||||
CSFML_CHECK_RETURN(soundBuffer, time);
|
||||
|
||||
time.Microseconds = soundBuffer->This.GetDuration().AsMicroseconds();
|
||||
time.microseconds = soundBuffer->This.getDuration().asMicroseconds();
|
||||
return time;
|
||||
}
|
||||
@@ -31,46 +31,46 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundBufferRecorder* sfSoundBufferRecorder_Create(void)
|
||||
sfSoundBufferRecorder* sfSoundBufferRecorder_create(void)
|
||||
{
|
||||
return new sfSoundBufferRecorder;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
{
|
||||
delete soundBufferRecorder;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
|
||||
void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
|
||||
{
|
||||
CSFML_CALL(soundBufferRecorder, Start(sampleRate));
|
||||
CSFML_CALL(soundBufferRecorder, start(sampleRate));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
void sfSoundBufferRecorder_stop(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
{
|
||||
CSFML_CALL(soundBufferRecorder, Stop());
|
||||
CSFML_CALL(soundBufferRecorder, stop());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBufferRecorder* soundBufferRecorder)
|
||||
unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBufferRecorder* soundBufferRecorder)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBufferRecorder, GetSampleRate(), 0);
|
||||
CSFML_CALL_RETURN(soundBufferRecorder, getSampleRate(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(const sfSoundBufferRecorder* soundBufferRecorder)
|
||||
const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder)
|
||||
{
|
||||
CSFML_CHECK_RETURN(soundBufferRecorder, NULL);
|
||||
|
||||
soundBufferRecorder->SoundBuffer.This = soundBufferRecorder->This.GetBuffer();
|
||||
soundBufferRecorder->SoundBuffer.This = soundBufferRecorder->This.getBuffer();
|
||||
|
||||
return &soundBufferRecorder->SoundBuffer;
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart,
|
||||
sfSoundRecorder* sfSoundRecorder_create(sfSoundRecorderStartCallback onStart,
|
||||
sfSoundRecorderProcessCallback onProcess,
|
||||
sfSoundRecorderStopCallback onStop,
|
||||
void* userData)
|
||||
@@ -41,35 +41,35 @@ sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart,
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder)
|
||||
void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
delete soundRecorder;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
|
||||
void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
|
||||
{
|
||||
CSFML_CALL(soundRecorder, Start(sampleRate));
|
||||
CSFML_CALL(soundRecorder, start(sampleRate));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder)
|
||||
void sfSoundRecorder_stop(sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
CSFML_CALL(soundRecorder, Stop());
|
||||
CSFML_CALL(soundRecorder, stop());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder* soundRecorder)
|
||||
unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundRecorder, GetSampleRate(), 0);
|
||||
CSFML_CALL_RETURN(soundRecorder, getSampleRate(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundRecorder_IsAvailable(void)
|
||||
sfBool sfSoundRecorder_isAvailable(void)
|
||||
{
|
||||
return sf::SoundRecorder::IsAvailable() ? sfTrue : sfFalse;
|
||||
return sf::SoundRecorder::isAvailable() ? sfTrue : sfFalse;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public :
|
||||
|
||||
private :
|
||||
|
||||
virtual bool OnStart()
|
||||
virtual bool onStart()
|
||||
{
|
||||
if (myStartCallback)
|
||||
return myStartCallback(myUserData) == sfTrue;
|
||||
@@ -61,7 +61,7 @@ private :
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool OnProcessSamples(const sf::Int16* samples, std::size_t sampleCount)
|
||||
virtual bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount)
|
||||
{
|
||||
if (myProcessCallback)
|
||||
return myProcessCallback(samples, sampleCount, myUserData) == sfTrue;
|
||||
@@ -69,7 +69,7 @@ private :
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void OnStop()
|
||||
virtual void onStop()
|
||||
{
|
||||
if (myStopCallback)
|
||||
myStopCallback(myUserData);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
|
||||
sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData,
|
||||
sfSoundStreamSeekCallback onSeek,
|
||||
unsigned int channelCount,
|
||||
unsigned int sampleRate,
|
||||
@@ -42,133 +42,133 @@ sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_Destroy(sfSoundStream* soundStream)
|
||||
void sfSoundStream_destroy(sfSoundStream* soundStream)
|
||||
{
|
||||
delete soundStream;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_Play(sfSoundStream* soundStream)
|
||||
void sfSoundStream_play(sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL(soundStream, Play());
|
||||
CSFML_CALL(soundStream, play());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_Pause(sfSoundStream* soundStream)
|
||||
void sfSoundStream_pause(sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL(soundStream, Pause());
|
||||
CSFML_CALL(soundStream, pause());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_Stop(sfSoundStream* soundStream)
|
||||
void sfSoundStream_stop(sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL(soundStream, Stop());
|
||||
CSFML_CALL(soundStream, stop());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream)
|
||||
sfSoundStatus sfSoundStream_getStatus(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CHECK_RETURN(soundStream, sfStopped);
|
||||
|
||||
return static_cast<sfSoundStatus>(soundStream->This.GetStatus());
|
||||
return static_cast<sfSoundStatus>(soundStream->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundStream_GetChannelCount(const sfSoundStream* soundStream)
|
||||
unsigned int sfSoundStream_getChannelCount(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetChannelCount(), 0);
|
||||
CSFML_CALL_RETURN(soundStream, getChannelCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* soundStream)
|
||||
unsigned int sfSoundStream_getSampleRate(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetSampleRate(), 0);
|
||||
CSFML_CALL_RETURN(soundStream, getSampleRate(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pitch)
|
||||
void sfSoundStream_setPitch(sfSoundStream* soundStream, float pitch)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetPitch(pitch));
|
||||
CSFML_CALL(soundStream, setPitch(pitch));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetVolume(sfSoundStream* soundStream, float volume)
|
||||
void sfSoundStream_setVolume(sfSoundStream* soundStream, float volume)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetVolume(volume));
|
||||
CSFML_CALL(soundStream, setVolume(volume));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetPosition(sfSoundStream* soundStream, sfVector3f position)
|
||||
void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVector3f position)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetPosition(position.x, position.y, position.z));
|
||||
CSFML_CALL(soundStream, setPosition(position.x, position.y, position.z));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStream, sfBool relative)
|
||||
void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetRelativeToListener(relative == sfTrue));
|
||||
CSFML_CALL(soundStream, setRelativeToListener(relative == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, float distance)
|
||||
void sfSoundStream_setMinDistance(sfSoundStream* soundStream, float distance)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetMinDistance(distance));
|
||||
CSFML_CALL(soundStream, setMinDistance(distance));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation)
|
||||
void sfSoundStream_setAttenuation(sfSoundStream* soundStream, float attenuation)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetAttenuation(attenuation));
|
||||
CSFML_CALL(soundStream, setAttenuation(attenuation));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset)
|
||||
void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetPlayingOffset(sf::Microseconds(timeOffset.Microseconds)));
|
||||
CSFML_CALL(soundStream, setPlayingOffset(sf::microseconds(timeOffset.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop)
|
||||
void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop)
|
||||
{
|
||||
CSFML_CALL(soundStream, SetLoop(loop == sfTrue));
|
||||
CSFML_CALL(soundStream, setLoop(loop == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSoundStream_GetPitch(const sfSoundStream* soundStream)
|
||||
float sfSoundStream_getPitch(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetPitch(), 0.f);
|
||||
CSFML_CALL_RETURN(soundStream, getPitch(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSoundStream_GetVolume(const sfSoundStream* soundStream)
|
||||
float sfSoundStream_getVolume(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetVolume(), 0.f);
|
||||
CSFML_CALL_RETURN(soundStream, getVolume(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector3f sfSoundStream_GetPosition(const sfSoundStream* soundStream)
|
||||
sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundStream)
|
||||
{
|
||||
sfVector3f position = {0, 0, 0};
|
||||
CSFML_CHECK_RETURN(soundStream, position);
|
||||
|
||||
sf::Vector3f sfmlPos = soundStream->This.GetPosition();
|
||||
sf::Vector3f sfmlPos = soundStream->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
position.z = sfmlPos.z;
|
||||
@@ -178,39 +178,39 @@ sfVector3f sfSoundStream_GetPosition(const sfSoundStream* soundStream)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* soundStream)
|
||||
CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, IsRelativeToListener(), sfFalse);
|
||||
CSFML_CALL_RETURN(soundStream, isRelativeToListener(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSoundStream_GetMinDistance(const sfSoundStream* soundStream)
|
||||
float sfSoundStream_getMinDistance(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetMinDistance(), 0.f);
|
||||
CSFML_CALL_RETURN(soundStream, getMinDistance(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSoundStream_GetAttenuation(const sfSoundStream* soundStream)
|
||||
float sfSoundStream_getAttenuation(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetAttenuation(), 0.f);
|
||||
CSFML_CALL_RETURN(soundStream, getAttenuation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream)
|
||||
sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundStream, GetLoop(), sfFalse);
|
||||
CSFML_CALL_RETURN(soundStream, getLoop(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream)
|
||||
sfTime sfSoundStream_getPlayingOffset(const sfSoundStream* soundStream)
|
||||
{
|
||||
sfTime time = {0};
|
||||
CSFML_CHECK_RETURN(soundStream, time);
|
||||
|
||||
time.Microseconds = soundStream->This.GetPlayingOffset().AsMicroseconds();
|
||||
time.microseconds = soundStream->This.getPlayingOffset().asMicroseconds();
|
||||
return time;
|
||||
}
|
||||
@@ -48,27 +48,27 @@ public :
|
||||
mySeekCallback (onSeek),
|
||||
myUserData (userData)
|
||||
{
|
||||
Initialize(channelCount, sampleRate);
|
||||
initialize(channelCount, sampleRate);
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
virtual bool OnGetData(Chunk& data)
|
||||
virtual bool onGetData(Chunk& data)
|
||||
{
|
||||
sfSoundStreamChunk chunk = {NULL, 0};
|
||||
bool ok = (myGetDataCallback(&chunk, myUserData) == sfTrue);
|
||||
|
||||
data.Samples = chunk.Samples;
|
||||
data.SampleCount = chunk.SampleCount;
|
||||
data.samples = chunk.samples;
|
||||
data.sampleCount = chunk.sampleCount;
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
virtual void OnSeek(sf::Time timeOffset)
|
||||
virtual void onSeek(sf::Time timeOffset)
|
||||
{
|
||||
if (mySeekCallback)
|
||||
{
|
||||
sfTime time = {timeOffset.AsMicroseconds()};
|
||||
sfTime time = {timeOffset.asMicroseconds()};
|
||||
mySeekCallback(time, myUserData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ public:
|
||||
/// \return The number of bytes actually read
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual sf::Int64 Read(char* data, sf::Int64 size)
|
||||
virtual sf::Int64 read(char* data, sf::Int64 size)
|
||||
{
|
||||
return myStream.Read ? myStream.Read(data, size, myStream.UserData) : -1;
|
||||
return myStream.read ? myStream.read(data, size, myStream.userData) : -1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -81,9 +81,9 @@ public:
|
||||
/// \return The position actually seeked to, or -1 on error
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual sf::Int64 Seek(sf::Int64 position)
|
||||
virtual sf::Int64 seek(sf::Int64 position)
|
||||
{
|
||||
return myStream.Seek ? myStream.Seek(position, myStream.UserData) : -1;
|
||||
return myStream.seek ? myStream.seek(position, myStream.userData) : -1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -92,9 +92,9 @@ public:
|
||||
/// \return The current position, or -1 on error.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual sf::Int64 Tell()
|
||||
virtual sf::Int64 tell()
|
||||
{
|
||||
return myStream.Tell ? myStream.Tell(myStream.UserData) : -1;
|
||||
return myStream.tell ? myStream.tell(myStream.userData) : -1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -103,9 +103,9 @@ public:
|
||||
/// \return The total number of bytes available in the stream, or -1 on error
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual sf::Int64 GetSize()
|
||||
virtual sf::Int64 getSize()
|
||||
{
|
||||
return myStream.GetSize ? myStream.GetSize(myStream.UserData) : -1;
|
||||
return myStream.getSize ? myStream.getSize(myStream.userData) : -1;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+25
-28
@@ -35,68 +35,65 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
// Define a function to convert a sf::Event ot a sfEvent
|
||||
////////////////////////////////////////////////////////////
|
||||
inline void ConvertEvent(const sf::Event& SFMLEvent, sfEvent* event)
|
||||
inline void convertEvent(const sf::Event& SFMLEvent, sfEvent* event)
|
||||
{
|
||||
// Convert its type
|
||||
event->Type = static_cast<sfEventType>(SFMLEvent.Type);
|
||||
event->type = static_cast<sfEventType>(SFMLEvent.type);
|
||||
|
||||
// Fill its fields
|
||||
switch (event->Type)
|
||||
switch (event->type)
|
||||
{
|
||||
case sfEvtResized :
|
||||
event->Size.Width = SFMLEvent.Size.Width;
|
||||
event->Size.Height = SFMLEvent.Size.Height;
|
||||
event->size.width = SFMLEvent.size.width;
|
||||
event->size.height = SFMLEvent.size.height;
|
||||
break;
|
||||
|
||||
case sfEvtTextEntered :
|
||||
event->Text.Unicode = SFMLEvent.Text.Unicode;
|
||||
event->text.unicode = SFMLEvent.text.unicode;
|
||||
break;
|
||||
|
||||
case sfEvtKeyReleased :
|
||||
case sfEvtKeyPressed :
|
||||
event->Key.Code = static_cast<sfKeyCode>(SFMLEvent.Key.Code);
|
||||
event->Key.Alt = SFMLEvent.Key.Alt ? sfTrue : sfFalse;
|
||||
event->Key.Control = SFMLEvent.Key.Control ? sfTrue : sfFalse;
|
||||
event->Key.Shift = SFMLEvent.Key.Shift ? sfTrue : sfFalse;
|
||||
event->Key.System = SFMLEvent.Key.System ? sfTrue : sfFalse;
|
||||
event->key.code = static_cast<sfKeyCode>(SFMLEvent.key.code);
|
||||
event->key.alt = SFMLEvent.key.alt ? sfTrue : sfFalse;
|
||||
event->key.control = SFMLEvent.key.control ? sfTrue : sfFalse;
|
||||
event->key.shift = SFMLEvent.key.shift ? sfTrue : sfFalse;
|
||||
event->key.system = SFMLEvent.key.system ? sfTrue : sfFalse;
|
||||
break;
|
||||
|
||||
case sfEvtMouseWheelMoved :
|
||||
event->MouseWheel.Delta = SFMLEvent.MouseWheel.Delta;
|
||||
event->MouseWheel.X = SFMLEvent.MouseWheel.X;
|
||||
event->MouseWheel.Y = SFMLEvent.MouseWheel.Y;
|
||||
event->mouseWheel.delta = SFMLEvent.mouseWheel.delta;
|
||||
event->mouseWheel.x = SFMLEvent.mouseWheel.x;
|
||||
event->mouseWheel.y = SFMLEvent.mouseWheel.y;
|
||||
break;
|
||||
|
||||
case sfEvtMouseButtonPressed :
|
||||
case sfEvtMouseButtonReleased :
|
||||
event->MouseButton.Button = static_cast<sfMouseButton>(SFMLEvent.MouseButton.Button);
|
||||
event->MouseButton.X = SFMLEvent.MouseButton.X;
|
||||
event->MouseButton.Y = SFMLEvent.MouseButton.Y;
|
||||
event->mouseButton.button = static_cast<sfMouseButton>(SFMLEvent.mouseButton.button);
|
||||
event->mouseButton.x = SFMLEvent.mouseButton.x;
|
||||
event->mouseButton.y = SFMLEvent.mouseButton.y;
|
||||
break;
|
||||
|
||||
case sfEvtMouseMoved :
|
||||
event->MouseMove.X = SFMLEvent.MouseMove.X;
|
||||
event->MouseMove.Y = SFMLEvent.MouseMove.Y;
|
||||
event->mouseMove.x = SFMLEvent.mouseMove.x;
|
||||
event->mouseMove.y = SFMLEvent.mouseMove.y;
|
||||
break;
|
||||
|
||||
case sfEvtJoystickButtonPressed :
|
||||
case sfEvtJoystickButtonReleased :
|
||||
event->JoystickButton.JoystickId = SFMLEvent.JoystickButton.JoystickId;
|
||||
event->JoystickButton.Button = SFMLEvent.JoystickButton.Button;
|
||||
event->joystickButton.joystickId = SFMLEvent.joystickButton.joystickId;
|
||||
event->joystickButton.button = SFMLEvent.joystickButton.button;
|
||||
break;
|
||||
|
||||
case sfEvtJoystickMoved :
|
||||
event->JoystickMove.JoystickId = SFMLEvent.JoystickMove.JoystickId;
|
||||
event->JoystickMove.Axis = static_cast<sfJoystickAxis>(SFMLEvent.JoystickMove.Axis);
|
||||
event->JoystickMove.Position = SFMLEvent.JoystickMove.Position;
|
||||
event->joystickMove.joystickId = SFMLEvent.joystickMove.joystickId;
|
||||
event->joystickMove.axis = static_cast<sfJoystickAxis>(SFMLEvent.joystickMove.axis);
|
||||
event->joystickMove.position = SFMLEvent.joystickMove.position;
|
||||
break;
|
||||
|
||||
case sfEvtJoystickConnected :
|
||||
event->JoystickConnect.JoystickId = SFMLEvent.JoystickConnect.JoystickId;
|
||||
break;
|
||||
|
||||
case sfEvtJoystickDisconnected :
|
||||
event->JoystickConnect.JoystickId = SFMLEvent.JoystickConnect.JoystickId;
|
||||
event->joystickConnect.joystickId = SFMLEvent.joystickConnect.joystickId;
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfCircleShape* sfCircleShape_Create(void)
|
||||
sfCircleShape* sfCircleShape_create(void)
|
||||
{
|
||||
sfCircleShape* shape = new sfCircleShape;
|
||||
shape->Texture = NULL;
|
||||
@@ -42,7 +42,7 @@ sfCircleShape* sfCircleShape_Create(void)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfCircleShape* sfCircleShape_Copy(sfCircleShape* shape)
|
||||
sfCircleShape* sfCircleShape_copy(sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -51,47 +51,47 @@ sfCircleShape* sfCircleShape_Copy(sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_Destroy(sfCircleShape* shape)
|
||||
void sfCircleShape_destroy(sfCircleShape* shape)
|
||||
{
|
||||
delete shape;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetPosition(sfCircleShape* shape, sfVector2f position)
|
||||
void sfCircleShape_setPosition(sfCircleShape* shape, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(shape, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(shape, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetRotation(sfCircleShape* shape, float angle)
|
||||
void sfCircleShape_setRotation(sfCircleShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, SetRotation(angle));
|
||||
CSFML_CALL(shape, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetScale(sfCircleShape* shape, sfVector2f scale)
|
||||
void sfCircleShape_setScale(sfCircleShape* shape, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(shape, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(shape, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetOrigin(sfCircleShape* shape, sfVector2f origin)
|
||||
void sfCircleShape_setOrigin(sfCircleShape* shape, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(shape, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(shape, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfCircleShape_GetPosition(const sfCircleShape* shape)
|
||||
sfVector2f sfCircleShape_getPosition(const sfCircleShape* shape)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, position);
|
||||
|
||||
sf::Vector2f sfmlPos = shape->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = shape->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -100,19 +100,19 @@ sfVector2f sfCircleShape_GetPosition(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfCircleShape_GetRotation(const sfCircleShape* shape)
|
||||
float sfCircleShape_getRotation(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape)
|
||||
sfVector2f sfCircleShape_getScale(const sfCircleShape* shape)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = shape->This.GetScale();
|
||||
sf::Vector2f sfmlScale = shape->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -121,12 +121,12 @@ sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape)
|
||||
sfVector2f sfCircleShape_getOrigin(const sfCircleShape* shape)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = shape->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = shape->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -135,84 +135,84 @@ sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_Move(sfCircleShape* shape, sfVector2f offset)
|
||||
void sfCircleShape_move(sfCircleShape* shape, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(shape, Move(offset.x, offset.y));
|
||||
CSFML_CALL(shape, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_Rotate(sfCircleShape* shape, float angle)
|
||||
void sfCircleShape_rotate(sfCircleShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, Rotate(angle));
|
||||
CSFML_CALL(shape, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_Scale(sfCircleShape* shape, sfVector2f factors)
|
||||
void sfCircleShape_scale(sfCircleShape* shape, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(shape, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(shape, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfCircleShape_GetTransform(const sfCircleShape* shape)
|
||||
const sfTransform* sfCircleShape_getTransform(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->Transform.This = shape->This.GetTransform();
|
||||
shape->Transform.This = shape->This.getTransform();
|
||||
return &shape->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfCircleShape_GetInverseTransform(const sfCircleShape* shape)
|
||||
const sfTransform* sfCircleShape_getInverseTransform(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->InverseTransform.This = shape->This.GetInverseTransform();
|
||||
shape->InverseTransform.This = shape->This.getInverseTransform();
|
||||
return &shape->InverseTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
shape->Texture = texture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetTextureRect(sfCircleShape* shape, sfIntRect rect)
|
||||
void sfCircleShape_setTextureRect(sfCircleShape* shape, sfIntRect rect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height)));
|
||||
CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetFillColor(sfCircleShape* shape, sfColor color)
|
||||
void sfCircleShape_setFillColor(sfCircleShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetOutlineColor(sfCircleShape* shape, sfColor color)
|
||||
void sfCircleShape_setOutlineColor(sfCircleShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetOutlineThickness(sfCircleShape* shape, float thickness)
|
||||
void sfCircleShape_setOutlineThickness(sfCircleShape* shape, float thickness)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineThickness(thickness));
|
||||
CSFML_CALL(shape, setOutlineThickness(thickness));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfCircleShape_GetTexture(const sfCircleShape* shape)
|
||||
const sfTexture* sfCircleShape_getTexture(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -221,28 +221,28 @@ const sfTexture* sfCircleShape_GetTexture(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfCircleShape_GetTextureRect(const sfCircleShape* shape)
|
||||
sfIntRect sfCircleShape_getTextureRect(const sfCircleShape* shape)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::IntRect sfmlRect = shape->This.GetTextureRect();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::IntRect sfmlRect = shape->This.getTextureRect();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfCircleShape_GetFillColor(const sfCircleShape* shape)
|
||||
sfColor sfCircleShape_getFillColor(const sfCircleShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetFillColor();
|
||||
sf::Color sfmlColor = shape->This.getFillColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -253,12 +253,12 @@ sfColor sfCircleShape_GetFillColor(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfCircleShape_GetOutlineColor(const sfCircleShape* shape)
|
||||
sfColor sfCircleShape_getOutlineColor(const sfCircleShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetOutlineColor();
|
||||
sf::Color sfmlColor = shape->This.getOutlineColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -269,26 +269,26 @@ sfColor sfCircleShape_GetOutlineColor(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfCircleShape_GetOutlineThickness(const sfCircleShape* shape)
|
||||
float sfCircleShape_getOutlineThickness(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfCircleShape_GetPointCount(const sfCircleShape* shape)
|
||||
unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetPointCount(), 0);
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfCircleShape_GetPoint(const sfCircleShape* shape, unsigned int index)
|
||||
sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
|
||||
sf::Vector2f sfmlPoint = shape->This.GetPoint(index);
|
||||
sf::Vector2f sfmlPoint = shape->This.getPoint(index);
|
||||
point.x = sfmlPoint.x;
|
||||
point.y = sfmlPoint.y;
|
||||
|
||||
@@ -297,53 +297,53 @@ sfVector2f sfCircleShape_GetPoint(const sfCircleShape* shape, unsigned int index
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetRadius(sfCircleShape* shape, float radius)
|
||||
void sfCircleShape_setRadius(sfCircleShape* shape, float radius)
|
||||
{
|
||||
CSFML_CALL(shape, SetRadius(radius));
|
||||
CSFML_CALL(shape, setRadius(radius));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfCircleShape_GetRadius(const sfCircleShape* shape)
|
||||
float sfCircleShape_getRadius(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetRadius(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getRadius(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_SetPointCount(sfCircleShape* shape, unsigned int count)
|
||||
void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count)
|
||||
{
|
||||
CSFML_CALL(shape, SetPointCount(count));
|
||||
CSFML_CALL(shape, setPointCount(count));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfCircleShape_GetLocalBounds(const sfCircleShape* shape)
|
||||
sfFloatRect sfCircleShape_getLocalBounds(const sfCircleShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getLocalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfCircleShape_GetGlobalBounds(const sfCircleShape* shape)
|
||||
sfFloatRect sfCircleShape_getGlobalBounds(const sfCircleShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getGlobalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
+16
-16
@@ -31,26 +31,26 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfBlack = sfColor_FromRGB( 0, 0, 0);
|
||||
sfColor sfWhite = sfColor_FromRGB(255, 255, 255);
|
||||
sfColor sfRed = sfColor_FromRGB(255, 0, 0);
|
||||
sfColor sfGreen = sfColor_FromRGB( 0, 255, 0);
|
||||
sfColor sfBlue = sfColor_FromRGB( 0, 0, 255);
|
||||
sfColor sfYellow = sfColor_FromRGB(255, 255, 0);
|
||||
sfColor sfMagenta = sfColor_FromRGB(255, 0, 255);
|
||||
sfColor sfCyan = sfColor_FromRGB( 0, 255, 255);
|
||||
sfColor sfTransparent = sfColor_FromRGBA( 0, 0, 0, 0);
|
||||
sfColor sfBlack = sfColor_fromRGB( 0, 0, 0);
|
||||
sfColor sfWhite = sfColor_fromRGB(255, 255, 255);
|
||||
sfColor sfRed = sfColor_fromRGB(255, 0, 0);
|
||||
sfColor sfGreen = sfColor_fromRGB( 0, 255, 0);
|
||||
sfColor sfBlue = sfColor_fromRGB( 0, 0, 255);
|
||||
sfColor sfYellow = sfColor_fromRGB(255, 255, 0);
|
||||
sfColor sfMagenta = sfColor_fromRGB(255, 0, 255);
|
||||
sfColor sfCyan = sfColor_fromRGB( 0, 255, 255);
|
||||
sfColor sfTransparent = sfColor_fromRGBA( 0, 0, 0, 0);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_FromRGB(sfUint8 red, sfUint8 green, sfUint8 blue)
|
||||
sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue)
|
||||
{
|
||||
return sfColor_FromRGBA(red, green, blue, 255);
|
||||
return sfColor_fromRGBA(red, green, blue, 255);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
|
||||
sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
|
||||
{
|
||||
sfColor color;
|
||||
|
||||
@@ -64,14 +64,14 @@ sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_Add(sfColor color1, sfColor color2)
|
||||
sfColor sfColor_add(sfColor color1, sfColor color2)
|
||||
{
|
||||
int red = std::min(color1.r + color2.r, 255);
|
||||
int green = std::min(color1.g + color2.g, 255);
|
||||
int blue = std::min(color1.b + color2.b, 255);
|
||||
int alpha = std::min(color1.a + color2.a, 255);
|
||||
|
||||
return sfColor_FromRGBA(static_cast<sfUint8>(red),
|
||||
return sfColor_fromRGBA(static_cast<sfUint8>(red),
|
||||
static_cast<sfUint8>(green),
|
||||
static_cast<sfUint8>(blue),
|
||||
static_cast<sfUint8>(alpha));
|
||||
@@ -79,14 +79,14 @@ sfColor sfColor_Add(sfColor color1, sfColor color2)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_Modulate(sfColor color1, sfColor color2)
|
||||
sfColor sfColor_modulate(sfColor color1, sfColor color2)
|
||||
{
|
||||
int red = color1.r * color2.r / 255;
|
||||
int green = color1.g * color2.g / 255;
|
||||
int blue = color1.b * color2.b / 255;
|
||||
int alpha = color1.a * color2.a / 255;
|
||||
|
||||
return sfColor_FromRGBA(static_cast<sfUint8>(red),
|
||||
return sfColor_fromRGBA(static_cast<sfUint8>(red),
|
||||
static_cast<sfUint8>(green),
|
||||
static_cast<sfUint8>(blue),
|
||||
static_cast<sfUint8>(alpha));
|
||||
|
||||
@@ -38,22 +38,19 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
// Convert sfRenderStates* to sf::RenderStates
|
||||
////////////////////////////////////////////////////////////
|
||||
inline sf::RenderStates ConvertRenderStates(const sfRenderStates* states)
|
||||
inline sf::RenderStates convertRenderStates(const sfRenderStates* states)
|
||||
{
|
||||
if (!states)
|
||||
{
|
||||
return sf::RenderStates::Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
sf::RenderStates sfmlStates;
|
||||
sfmlStates.BlendMode = static_cast<sf::BlendMode>(states->BlendMode);
|
||||
sfmlStates.Transform = states->Transform ? states->Transform->This : sf::Transform::Identity;
|
||||
sfmlStates.Texture = states->Texture ? states->Texture->This : NULL;
|
||||
sfmlStates.Shader = states->Shader ? &states->Shader->This : NULL;
|
||||
sf::RenderStates sfmlStates;
|
||||
|
||||
return sfmlStates;
|
||||
if (states)
|
||||
{
|
||||
sfmlStates.blendMode = static_cast<sf::BlendMode>(states->blendMode);
|
||||
sfmlStates.transform = states->transform ? states->transform->This : sf::Transform::Identity;
|
||||
sfmlStates.texture = states->texture ? states->texture->This : NULL;
|
||||
sfmlStates.shader = states->shader ? &states->shader->This : NULL;
|
||||
}
|
||||
|
||||
return sfmlStates;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfConvexShape* sfConvexShape_Create(void)
|
||||
sfConvexShape* sfConvexShape_create(void)
|
||||
{
|
||||
return new sfConvexShape;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfConvexShape* sfConvexShape_Copy(sfConvexShape* shape)
|
||||
sfConvexShape* sfConvexShape_copy(sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -48,47 +48,47 @@ sfConvexShape* sfConvexShape_Copy(sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_Destroy(sfConvexShape* shape)
|
||||
void sfConvexShape_destroy(sfConvexShape* shape)
|
||||
{
|
||||
delete shape;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetPosition(sfConvexShape* shape, sfVector2f position)
|
||||
void sfConvexShape_setPosition(sfConvexShape* shape, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(shape, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(shape, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetRotation(sfConvexShape* shape, float angle)
|
||||
void sfConvexShape_setRotation(sfConvexShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, SetRotation(angle));
|
||||
CSFML_CALL(shape, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetScale(sfConvexShape* shape, sfVector2f scale)
|
||||
void sfConvexShape_setScale(sfConvexShape* shape, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(shape, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(shape, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetOrigin(sfConvexShape* shape, sfVector2f origin)
|
||||
void sfConvexShape_setOrigin(sfConvexShape* shape, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(shape, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(shape, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfConvexShape_GetPosition(const sfConvexShape* shape)
|
||||
sfVector2f sfConvexShape_getPosition(const sfConvexShape* shape)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, position);
|
||||
|
||||
sf::Vector2f sfmlPos = shape->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = shape->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -97,19 +97,19 @@ sfVector2f sfConvexShape_GetPosition(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfConvexShape_GetRotation(const sfConvexShape* shape)
|
||||
float sfConvexShape_getRotation(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfConvexShape_GetScale(const sfConvexShape* shape)
|
||||
sfVector2f sfConvexShape_getScale(const sfConvexShape* shape)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = shape->This.GetScale();
|
||||
sf::Vector2f sfmlScale = shape->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -118,12 +118,12 @@ sfVector2f sfConvexShape_GetScale(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfConvexShape_GetOrigin(const sfConvexShape* shape)
|
||||
sfVector2f sfConvexShape_getOrigin(const sfConvexShape* shape)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = shape->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = shape->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -132,84 +132,84 @@ sfVector2f sfConvexShape_GetOrigin(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_Move(sfConvexShape* shape, sfVector2f offset)
|
||||
void sfConvexShape_move(sfConvexShape* shape, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(shape, Move(offset.x, offset.y));
|
||||
CSFML_CALL(shape, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_Rotate(sfConvexShape* shape, float angle)
|
||||
void sfConvexShape_rotate(sfConvexShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, Rotate(angle));
|
||||
CSFML_CALL(shape, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_Scale(sfConvexShape* shape, sfVector2f factors)
|
||||
void sfConvexShape_scale(sfConvexShape* shape, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(shape, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(shape, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfConvexShape_GetTransform(const sfConvexShape* shape)
|
||||
const sfTransform* sfConvexShape_getTransform(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->Transform.This = shape->This.GetTransform();
|
||||
shape->Transform.This = shape->This.getTransform();
|
||||
return &shape->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfConvexShape_GetInverseTransform(const sfConvexShape* shape)
|
||||
const sfTransform* sfConvexShape_getInverseTransform(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->InverseTransform.This = shape->This.GetInverseTransform();
|
||||
shape->InverseTransform.This = shape->This.getInverseTransform();
|
||||
return &shape->InverseTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
shape->Texture = texture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetTextureRect(sfConvexShape* shape, sfIntRect rect)
|
||||
void sfConvexShape_setTextureRect(sfConvexShape* shape, sfIntRect rect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height)));
|
||||
CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetFillColor(sfConvexShape* shape, sfColor color)
|
||||
void sfConvexShape_setFillColor(sfConvexShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetOutlineColor(sfConvexShape* shape, sfColor color)
|
||||
void sfConvexShape_setOutlineColor(sfConvexShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetOutlineThickness(sfConvexShape* shape, float thickness)
|
||||
void sfConvexShape_setOutlineThickness(sfConvexShape* shape, float thickness)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineThickness(thickness));
|
||||
CSFML_CALL(shape, setOutlineThickness(thickness));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfConvexShape_GetTexture(const sfConvexShape* shape)
|
||||
const sfTexture* sfConvexShape_getTexture(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -218,28 +218,28 @@ const sfTexture* sfConvexShape_GetTexture(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfConvexShape_GetTextureRect(const sfConvexShape* shape)
|
||||
sfIntRect sfConvexShape_getTextureRect(const sfConvexShape* shape)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::IntRect sfmlRect = shape->This.GetTextureRect();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::IntRect sfmlRect = shape->This.getTextureRect();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfConvexShape_GetFillColor(const sfConvexShape* shape)
|
||||
sfColor sfConvexShape_getFillColor(const sfConvexShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetFillColor();
|
||||
sf::Color sfmlColor = shape->This.getFillColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -250,12 +250,12 @@ sfColor sfConvexShape_GetFillColor(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfConvexShape_GetOutlineColor(const sfConvexShape* shape)
|
||||
sfColor sfConvexShape_getOutlineColor(const sfConvexShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetOutlineColor();
|
||||
sf::Color sfmlColor = shape->This.getOutlineColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -266,26 +266,26 @@ sfColor sfConvexShape_GetOutlineColor(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfConvexShape_GetOutlineThickness(const sfConvexShape* shape)
|
||||
float sfConvexShape_getOutlineThickness(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfConvexShape_GetPointCount(const sfConvexShape* shape)
|
||||
unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetPointCount(), 0);
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfConvexShape_GetPoint(const sfConvexShape* shape, unsigned int index)
|
||||
sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
|
||||
sf::Vector2f sfmlPoint = shape->This.GetPoint(index);
|
||||
sf::Vector2f sfmlPoint = shape->This.getPoint(index);
|
||||
point.x = sfmlPoint.x;
|
||||
point.y = sfmlPoint.y;
|
||||
|
||||
@@ -294,46 +294,46 @@ sfVector2f sfConvexShape_GetPoint(const sfConvexShape* shape, unsigned int index
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetPointCount(sfConvexShape* shape, unsigned int count)
|
||||
void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count)
|
||||
{
|
||||
CSFML_CALL(shape, SetPointCount(count));
|
||||
CSFML_CALL(shape, setPointCount(count));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_SetPoint(sfConvexShape* shape, unsigned int index, sfVector2f point)
|
||||
void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point)
|
||||
{
|
||||
CSFML_CALL(shape, SetPoint(index, sf::Vector2f(point.x, point.y)));
|
||||
CSFML_CALL(shape, setPoint(index, sf::Vector2f(point.x, point.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfConvexShape_GetLocalBounds(const sfConvexShape* shape)
|
||||
sfFloatRect sfConvexShape_getLocalBounds(const sfConvexShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getLocalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfConvexShape_GetGlobalBounds(const sfConvexShape* shape)
|
||||
sfFloatRect sfConvexShape_getGlobalBounds(const sfConvexShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getGlobalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
+27
-27
@@ -34,10 +34,10 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a new font from a file
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFont* sfFont_CreateFromFile(const char* filename)
|
||||
sfFont* sfFont_createFromFile(const char* filename)
|
||||
{
|
||||
sfFont* font = new sfFont;
|
||||
if (!font->This.LoadFromFile(filename))
|
||||
if (!font->This.loadFromFile(filename))
|
||||
{
|
||||
delete font;
|
||||
font = NULL;
|
||||
@@ -50,10 +50,10 @@ sfFont* sfFont_CreateFromFile(const char* filename)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a new font from a file in memory
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFont* sfFont_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
sfFont* sfFont_createFromMemory(const void* data, size_t sizeInBytes)
|
||||
{
|
||||
sfFont* font = new sfFont;
|
||||
if (!font->This.LoadFromMemory(data, sizeInBytes))
|
||||
if (!font->This.loadFromMemory(data, sizeInBytes))
|
||||
{
|
||||
delete font;
|
||||
font = NULL;
|
||||
@@ -66,13 +66,13 @@ sfFont* sfFont_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a new font from a custom stream
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFont* sfFont_CreateFromStream(sfInputStream* stream)
|
||||
sfFont* sfFont_createFromStream(sfInputStream* stream)
|
||||
{
|
||||
CSFML_CHECK_RETURN(stream, NULL);
|
||||
|
||||
sfFont* font = new sfFont;
|
||||
font->Stream = CallbackStream(stream);
|
||||
if (!font->This.LoadFromStream(font->Stream))
|
||||
if (!font->This.loadFromStream(font->Stream))
|
||||
{
|
||||
delete font;
|
||||
font = NULL;
|
||||
@@ -85,7 +85,7 @@ sfFont* sfFont_CreateFromStream(sfInputStream* stream)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Copy an existing font
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFont* sfFont_Copy(sfFont* font)
|
||||
sfFont* sfFont_copy(sfFont* font)
|
||||
{
|
||||
CSFML_CHECK_RETURN(font, NULL);
|
||||
|
||||
@@ -96,7 +96,7 @@ sfFont* sfFont_Copy(sfFont* font)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destroy an existing font
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfFont_Destroy(sfFont* font)
|
||||
void sfFont_destroy(sfFont* font)
|
||||
{
|
||||
delete font;
|
||||
}
|
||||
@@ -105,22 +105,22 @@ void sfFont_Destroy(sfFont* font)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get a glyph in a font
|
||||
////////////////////////////////////////////////////////////
|
||||
sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold)
|
||||
sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold)
|
||||
{
|
||||
sfGlyph glyph = {0, {0, 0, 0, 0}, {0, 0, 0, 0}};
|
||||
CSFML_CHECK_RETURN(font, glyph);
|
||||
|
||||
sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize, bold == sfTrue);
|
||||
sf::Glyph SFMLGlyph = font->This.getGlyph(codePoint, characterSize, bold == sfTrue);
|
||||
|
||||
glyph.Advance = SFMLGlyph.Advance;
|
||||
glyph.Bounds.Left = SFMLGlyph.Bounds.Left;
|
||||
glyph.Bounds.Top = SFMLGlyph.Bounds.Top;
|
||||
glyph.Bounds.Width = SFMLGlyph.Bounds.Width;
|
||||
glyph.Bounds.Height = SFMLGlyph.Bounds.Height;
|
||||
glyph.TextureRect.Left = SFMLGlyph.TextureRect.Left;
|
||||
glyph.TextureRect.Top = SFMLGlyph.TextureRect.Top;
|
||||
glyph.TextureRect.Width = SFMLGlyph.TextureRect.Width;
|
||||
glyph.TextureRect.Height = SFMLGlyph.TextureRect.Height;
|
||||
glyph.advance = SFMLGlyph.advance;
|
||||
glyph.bounds.left = SFMLGlyph.bounds.left;
|
||||
glyph.bounds.top = SFMLGlyph.bounds.top;
|
||||
glyph.bounds.width = SFMLGlyph.bounds.width;
|
||||
glyph.bounds.height = SFMLGlyph.bounds.height;
|
||||
glyph.textureRect.left = SFMLGlyph.textureRect.left;
|
||||
glyph.textureRect.top = SFMLGlyph.textureRect.top;
|
||||
glyph.textureRect.width = SFMLGlyph.textureRect.width;
|
||||
glyph.textureRect.height = SFMLGlyph.textureRect.height;
|
||||
|
||||
return glyph;
|
||||
}
|
||||
@@ -129,29 +129,29 @@ sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int character
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the kerning value corresponding to a given pair of characters in a font
|
||||
////////////////////////////////////////////////////////////
|
||||
int sfFont_GetKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize)
|
||||
int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize)
|
||||
{
|
||||
CSFML_CALL_RETURN(font, GetKerning(first, second, characterSize), 0);
|
||||
CSFML_CALL_RETURN(font, getKerning(first, second, characterSize), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the line spacing value
|
||||
////////////////////////////////////////////////////////////
|
||||
int sfFont_GetLineSpacing(sfFont* font, unsigned int characterSize)
|
||||
int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize)
|
||||
{
|
||||
CSFML_CALL_RETURN(font, GetLineSpacing(characterSize), 0);
|
||||
CSFML_CALL_RETURN(font, getLineSpacing(characterSize), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the texture containing the glyphs of a given size in a font
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfFont_GetTexture(sfFont* font, unsigned int characterSize)
|
||||
const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize)
|
||||
{
|
||||
CSFML_CHECK_RETURN(font, NULL);
|
||||
|
||||
*font->Textures[characterSize].This = font->This.GetTexture(characterSize);
|
||||
*font->Textures[characterSize].This = font->This.getTexture(characterSize);
|
||||
|
||||
return &font->Textures[characterSize];
|
||||
}
|
||||
@@ -160,9 +160,9 @@ const sfTexture* sfFont_GetTexture(sfFont* font, unsigned int characterSize)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the built-in default font (Arial)
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfFont* sfFont_GetDefaultFont(void)
|
||||
const sfFont* sfFont_getDefaultFont(void)
|
||||
{
|
||||
static sfFont defaultFont = {sf::Font::GetDefaultFont(), std::map<unsigned int, sfTexture>()};
|
||||
static sfFont defaultFont = {sf::Font::getDefaultFont(), std::map<unsigned int, sfTexture>()};
|
||||
|
||||
return &defaultFont;
|
||||
}
|
||||
+36
-36
@@ -31,41 +31,41 @@
|
||||
#include <SFML/CallbackStream.h>
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_Create(unsigned int width, unsigned int height)
|
||||
sfImage* sfImage_create(unsigned int width, unsigned int height)
|
||||
{
|
||||
sfImage* image = new sfImage;
|
||||
image->This.Create(width, height);
|
||||
image->This.create(width, height);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_CreateFromColor(unsigned int width, unsigned int height, sfColor color)
|
||||
sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColor color)
|
||||
{
|
||||
sfImage* image = new sfImage;
|
||||
image->This.Create(width, height, sf::Color(color.r, color.g, color.b, color.a));
|
||||
image->This.create(width, height, sf::Color(color.r, color.g, color.b, color.a));
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_CreateFromPixels(unsigned int width, unsigned int height, const sfUint8* data)
|
||||
sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* data)
|
||||
{
|
||||
sfImage* image = new sfImage;
|
||||
image->This.Create(width, height, data);
|
||||
image->This.create(width, height, data);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_CreateFromFile(const char* filename)
|
||||
sfImage* sfImage_createFromFile(const char* filename)
|
||||
{
|
||||
sfImage* image = new sfImage;
|
||||
|
||||
if (!image->This.LoadFromFile(filename))
|
||||
if (!image->This.loadFromFile(filename))
|
||||
{
|
||||
delete image;
|
||||
image = NULL;
|
||||
@@ -76,11 +76,11 @@ sfImage* sfImage_CreateFromFile(const char* filename)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
sfImage* sfImage_createFromMemory(const void* data, size_t sizeInBytes)
|
||||
{
|
||||
sfImage* image = new sfImage;
|
||||
|
||||
if (!image->This.LoadFromMemory(data, sizeInBytes))
|
||||
if (!image->This.loadFromMemory(data, sizeInBytes))
|
||||
{
|
||||
delete image;
|
||||
image = NULL;
|
||||
@@ -91,14 +91,14 @@ sfImage* sfImage_CreateFromMemory(const void* data, size_t sizeInBytes)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_CreateFromStream(sfInputStream* stream)
|
||||
sfImage* sfImage_createFromStream(sfInputStream* stream)
|
||||
{
|
||||
CSFML_CHECK_RETURN(stream, NULL);
|
||||
|
||||
sfImage* image = new sfImage;
|
||||
|
||||
CallbackStream sfmlStream(stream);
|
||||
if (!image->This.LoadFromStream(sfmlStream))
|
||||
if (!image->This.loadFromStream(sfmlStream))
|
||||
{
|
||||
delete image;
|
||||
image = NULL;
|
||||
@@ -109,7 +109,7 @@ sfImage* sfImage_CreateFromStream(sfInputStream* stream)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfImage_Copy(sfImage* image)
|
||||
sfImage* sfImage_copy(sfImage* image)
|
||||
{
|
||||
CSFML_CHECK_RETURN(image, NULL);
|
||||
|
||||
@@ -118,84 +118,84 @@ sfImage* sfImage_Copy(sfImage* image)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfImage_Destroy(sfImage* image)
|
||||
void sfImage_destroy(sfImage* image)
|
||||
{
|
||||
delete image;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfImage_SaveToFile(const sfImage* image, const char* filename)
|
||||
sfBool sfImage_saveToFile(const sfImage* image, const char* filename)
|
||||
{
|
||||
CSFML_CALL_RETURN(image, SaveToFile(filename), sfFalse);
|
||||
CSFML_CALL_RETURN(image, saveToFile(filename), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha)
|
||||
void sfImage_createMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha)
|
||||
{
|
||||
CSFML_CALL(image, CreateMaskFromColor(sf::Color(colorKey.r, colorKey.g, colorKey.b, colorKey.a), alpha));
|
||||
CSFML_CALL(image, createMaskFromColor(sf::Color(colorKey.r, colorKey.g, colorKey.b, colorKey.a), alpha));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfImage_CopyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha)
|
||||
void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha)
|
||||
{
|
||||
CSFML_CHECK(source);
|
||||
sf::IntRect sfmlRect(sourceRect.Left, sourceRect.Top, sourceRect.Width, sourceRect.Height);
|
||||
CSFML_CALL(image, Copy(source->This, destX, destY, sfmlRect, applyAlpha == sfTrue));
|
||||
sf::IntRect sfmlRect(sourceRect.left, sourceRect.top, sourceRect.width, sourceRect.height);
|
||||
CSFML_CALL(image, copy(source->This, destX, destY, sfmlRect, applyAlpha == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color)
|
||||
void sfImage_setPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color)
|
||||
{
|
||||
CSFML_CALL(image, SetPixel(x, y, sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(image, setPixel(x, y, sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfImage_GetPixel(const sfImage* image, unsigned int x, unsigned int y)
|
||||
sfColor sfImage_getPixel(const sfImage* image, unsigned int x, unsigned int y)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(image, color);
|
||||
|
||||
sf::Color sfmlColor = image->This.GetPixel(x, y);
|
||||
sf::Color sfmlColor = image->This.getPixel(x, y);
|
||||
|
||||
return sfColor_FromRGBA(sfmlColor.r, sfmlColor.g, sfmlColor.b, sfmlColor.a);
|
||||
return sfColor_fromRGBA(sfmlColor.r, sfmlColor.g, sfmlColor.b, sfmlColor.a);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfUint8* sfImage_GetPixelsPtr(const sfImage* image)
|
||||
const sfUint8* sfImage_getPixelsPtr(const sfImage* image)
|
||||
{
|
||||
CSFML_CALL_RETURN(image, GetPixelsPtr(), NULL);
|
||||
CSFML_CALL_RETURN(image, getPixelsPtr(), NULL);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfImage_GetWidth(const sfImage* image)
|
||||
unsigned int sfImage_getWidth(const sfImage* image)
|
||||
{
|
||||
CSFML_CALL_RETURN(image, GetWidth(), 0);
|
||||
CSFML_CALL_RETURN(image, getWidth(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfImage_GetHeight(const sfImage* image)
|
||||
unsigned int sfImage_getHeight(const sfImage* image)
|
||||
{
|
||||
CSFML_CALL_RETURN(image, GetHeight(), 0);
|
||||
CSFML_CALL_RETURN(image, getHeight(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfImage_FlipHorizontally(sfImage* image)
|
||||
void sfImage_flipHorizontally(sfImage* image)
|
||||
{
|
||||
CSFML_CALL(image, FlipHorizontally());
|
||||
CSFML_CALL(image, flipHorizontally());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfImage_FlipVertically(sfImage* image)
|
||||
void sfImage_flipVertically(sfImage* image)
|
||||
{
|
||||
CSFML_CALL(image, FlipVertically());
|
||||
CSFML_CALL(image, flipVertically());
|
||||
}
|
||||
+22
-22
@@ -33,68 +33,68 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Check if a point is inside a rectangle's area
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfFloatRect_Contains(const sfFloatRect* rect, float x, float y)
|
||||
sfBool sfFloatRect_contains(const sfFloatRect* rect, float x, float y)
|
||||
{
|
||||
CSFML_CHECK_RETURN(rect, sfFalse);
|
||||
return sf::FloatRect(rect->Left, rect->Top, rect->Width, rect->Height).Contains(x, y);
|
||||
return sf::FloatRect(rect->left, rect->top, rect->width, rect->height).contains(x, y);
|
||||
}
|
||||
sfBool sfIntRect_Contains(const sfIntRect* rect, int x, int y)
|
||||
sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y)
|
||||
{
|
||||
CSFML_CHECK_RETURN(rect, sfFalse);
|
||||
return sf::IntRect(rect->Left, rect->Top, rect->Width, rect->Height).Contains(x, y);
|
||||
return sf::IntRect(rect->left, rect->top, rect->width, rect->height).contains(x, y);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Check intersection between two rectangles
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfFloatRect_Intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection)
|
||||
sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection)
|
||||
{
|
||||
CSFML_CHECK_RETURN(rect1, sfFalse);
|
||||
CSFML_CHECK_RETURN(rect2, sfFalse);
|
||||
|
||||
sf::FloatRect SFMLRect1(rect1->Left, rect1->Top, rect1->Width, rect1->Height);
|
||||
sf::FloatRect SFMLRect2(rect2->Left, rect2->Top, rect2->Width, rect2->Height);
|
||||
sf::FloatRect SFMLRect1(rect1->left, rect1->top, rect1->width, rect1->height);
|
||||
sf::FloatRect SFMLRect2(rect2->left, rect2->top, rect2->width, rect2->height);
|
||||
|
||||
if (intersection)
|
||||
{
|
||||
sf::FloatRect overlap;
|
||||
bool intersects = SFMLRect1.Intersects(SFMLRect2, overlap);
|
||||
bool intersects = SFMLRect1.intersects(SFMLRect2, overlap);
|
||||
|
||||
intersection->Left = overlap.Left;
|
||||
intersection->Top = overlap.Top;
|
||||
intersection->Width = overlap.Width;
|
||||
intersection->Height = overlap.Height;
|
||||
intersection->left = overlap.left;
|
||||
intersection->top = overlap.top;
|
||||
intersection->width = overlap.width;
|
||||
intersection->height = overlap.height;
|
||||
|
||||
return intersects;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SFMLRect1.Intersects(SFMLRect2);
|
||||
return SFMLRect1.intersects(SFMLRect2);
|
||||
}
|
||||
}
|
||||
sfBool sfIntRect_Intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection)
|
||||
sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection)
|
||||
{
|
||||
CSFML_CHECK_RETURN(rect1, sfFalse);
|
||||
CSFML_CHECK_RETURN(rect2, sfFalse);
|
||||
|
||||
sf::IntRect SFMLRect1(rect1->Left, rect1->Top, rect1->Width, rect1->Height);
|
||||
sf::IntRect SFMLRect2(rect2->Left, rect2->Top, rect2->Width, rect2->Height);
|
||||
sf::IntRect SFMLRect1(rect1->left, rect1->top, rect1->width, rect1->height);
|
||||
sf::IntRect SFMLRect2(rect2->left, rect2->top, rect2->width, rect2->height);
|
||||
|
||||
if (intersection)
|
||||
{
|
||||
sf::IntRect overlap;
|
||||
bool intersects = SFMLRect1.Intersects(SFMLRect2, overlap);
|
||||
bool intersects = SFMLRect1.intersects(SFMLRect2, overlap);
|
||||
|
||||
intersection->Left = overlap.Left;
|
||||
intersection->Top = overlap.Top;
|
||||
intersection->Width = overlap.Width;
|
||||
intersection->Height = overlap.Height;
|
||||
intersection->left = overlap.left;
|
||||
intersection->top = overlap.top;
|
||||
intersection->width = overlap.width;
|
||||
intersection->height = overlap.height;
|
||||
|
||||
return intersects;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SFMLRect1.Intersects(SFMLRect2);
|
||||
return SFMLRect1.intersects(SFMLRect2);
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfRectangleShape* sfRectangleShape_Create(void)
|
||||
sfRectangleShape* sfRectangleShape_create(void)
|
||||
{
|
||||
return new sfRectangleShape;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfRectangleShape* sfRectangleShape_Copy(sfRectangleShape* shape)
|
||||
sfRectangleShape* sfRectangleShape_copy(sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -48,47 +48,47 @@ sfRectangleShape* sfRectangleShape_Copy(sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_Destroy(sfRectangleShape* shape)
|
||||
void sfRectangleShape_destroy(sfRectangleShape* shape)
|
||||
{
|
||||
delete shape;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetPosition(sfRectangleShape* shape, sfVector2f position)
|
||||
void sfRectangleShape_setPosition(sfRectangleShape* shape, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(shape, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(shape, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetRotation(sfRectangleShape* shape, float angle)
|
||||
void sfRectangleShape_setRotation(sfRectangleShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, SetRotation(angle));
|
||||
CSFML_CALL(shape, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetScale(sfRectangleShape* shape, sfVector2f scale)
|
||||
void sfRectangleShape_setScale(sfRectangleShape* shape, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(shape, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(shape, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetOrigin(sfRectangleShape* shape, sfVector2f origin)
|
||||
void sfRectangleShape_setOrigin(sfRectangleShape* shape, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(shape, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(shape, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfRectangleShape_GetPosition(const sfRectangleShape* shape)
|
||||
sfVector2f sfRectangleShape_getPosition(const sfRectangleShape* shape)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, position);
|
||||
|
||||
sf::Vector2f sfmlPos = shape->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = shape->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -97,19 +97,19 @@ sfVector2f sfRectangleShape_GetPosition(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfRectangleShape_GetRotation(const sfRectangleShape* shape)
|
||||
float sfRectangleShape_getRotation(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfRectangleShape_GetScale(const sfRectangleShape* shape)
|
||||
sfVector2f sfRectangleShape_getScale(const sfRectangleShape* shape)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = shape->This.GetScale();
|
||||
sf::Vector2f sfmlScale = shape->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -118,12 +118,12 @@ sfVector2f sfRectangleShape_GetScale(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfRectangleShape_GetOrigin(const sfRectangleShape* shape)
|
||||
sfVector2f sfRectangleShape_getOrigin(const sfRectangleShape* shape)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = shape->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = shape->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -132,84 +132,84 @@ sfVector2f sfRectangleShape_GetOrigin(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_Move(sfRectangleShape* shape, sfVector2f offset)
|
||||
void sfRectangleShape_move(sfRectangleShape* shape, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(shape, Move(offset.x, offset.y));
|
||||
CSFML_CALL(shape, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_Rotate(sfRectangleShape* shape, float angle)
|
||||
void sfRectangleShape_rotate(sfRectangleShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, Rotate(angle));
|
||||
CSFML_CALL(shape, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_Scale(sfRectangleShape* shape, sfVector2f factors)
|
||||
void sfRectangleShape_scale(sfRectangleShape* shape, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(shape, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(shape, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfRectangleShape_GetTransform(const sfRectangleShape* shape)
|
||||
const sfTransform* sfRectangleShape_getTransform(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->Transform.This = shape->This.GetTransform();
|
||||
shape->Transform.This = shape->This.getTransform();
|
||||
return &shape->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfRectangleShape_GetInverseTransform(const sfRectangleShape* shape)
|
||||
const sfTransform* sfRectangleShape_getInverseTransform(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->InverseTransform.This = shape->This.GetInverseTransform();
|
||||
shape->InverseTransform.This = shape->This.getInverseTransform();
|
||||
return &shape->InverseTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
shape->Texture = texture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetTextureRect(sfRectangleShape* shape, sfIntRect rect)
|
||||
void sfRectangleShape_setTextureRect(sfRectangleShape* shape, sfIntRect rect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height)));
|
||||
CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetFillColor(sfRectangleShape* shape, sfColor color)
|
||||
void sfRectangleShape_setFillColor(sfRectangleShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetOutlineColor(sfRectangleShape* shape, sfColor color)
|
||||
void sfRectangleShape_setOutlineColor(sfRectangleShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetOutlineThickness(sfRectangleShape* shape, float thickness)
|
||||
void sfRectangleShape_setOutlineThickness(sfRectangleShape* shape, float thickness)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineThickness(thickness));
|
||||
CSFML_CALL(shape, setOutlineThickness(thickness));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfRectangleShape_GetTexture(const sfRectangleShape* shape)
|
||||
const sfTexture* sfRectangleShape_getTexture(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -218,28 +218,28 @@ const sfTexture* sfRectangleShape_GetTexture(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfRectangleShape_GetTextureRect(const sfRectangleShape* shape)
|
||||
sfIntRect sfRectangleShape_getTextureRect(const sfRectangleShape* shape)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::IntRect sfmlRect = shape->This.GetTextureRect();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::IntRect sfmlRect = shape->This.getTextureRect();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfRectangleShape_GetFillColor(const sfRectangleShape* shape)
|
||||
sfColor sfRectangleShape_getFillColor(const sfRectangleShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetFillColor();
|
||||
sf::Color sfmlColor = shape->This.getFillColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -250,12 +250,12 @@ sfColor sfRectangleShape_GetFillColor(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfRectangleShape_GetOutlineColor(const sfRectangleShape* shape)
|
||||
sfColor sfRectangleShape_getOutlineColor(const sfRectangleShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetOutlineColor();
|
||||
sf::Color sfmlColor = shape->This.getOutlineColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -266,26 +266,26 @@ sfColor sfRectangleShape_GetOutlineColor(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfRectangleShape_GetOutlineThickness(const sfRectangleShape* shape)
|
||||
float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfRectangleShape_GetPointCount(const sfRectangleShape* shape)
|
||||
unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetPointCount(), 0);
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfRectangleShape_GetPoint(const sfRectangleShape* shape, unsigned int index)
|
||||
sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
|
||||
sf::Vector2f sfmlPoint = shape->This.GetPoint(index);
|
||||
sf::Vector2f sfmlPoint = shape->This.getPoint(index);
|
||||
point.x = sfmlPoint.x;
|
||||
point.y = sfmlPoint.y;
|
||||
|
||||
@@ -294,19 +294,19 @@ sfVector2f sfRectangleShape_GetPoint(const sfRectangleShape* shape, unsigned int
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRectangleShape_SetSize(sfRectangleShape* shape, sfVector2f size)
|
||||
void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size)
|
||||
{
|
||||
CSFML_CALL(shape, SetSize(sf::Vector2f(size.x, size.y)));
|
||||
CSFML_CALL(shape, setSize(sf::Vector2f(size.x, size.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfRectangleShape_GetSize(const sfRectangleShape* shape)
|
||||
sfVector2f sfRectangleShape_getSize(const sfRectangleShape* shape)
|
||||
{
|
||||
sfVector2f size = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, size);
|
||||
|
||||
sf::Vector2f sfmlSize = shape->This.GetSize();
|
||||
sf::Vector2f sfmlSize = shape->This.getSize();
|
||||
size.x = sfmlSize.x;
|
||||
size.y = sfmlSize.y;
|
||||
|
||||
@@ -315,32 +315,32 @@ sfVector2f sfRectangleShape_GetSize(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfRectangleShape_GetLocalBounds(const sfRectangleShape* shape)
|
||||
sfFloatRect sfRectangleShape_getLocalBounds(const sfRectangleShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getLocalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfRectangleShape_GetGlobalBounds(const sfRectangleShape* shape)
|
||||
sfFloatRect sfRectangleShape_getGlobalBounds(const sfRectangleShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getGlobalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
@@ -39,20 +39,20 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfRenderTexture* sfRenderTexture_Create(unsigned int width, unsigned int height, sfBool depthBuffer)
|
||||
sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer)
|
||||
{
|
||||
sfRenderTexture* renderTexture = new sfRenderTexture;
|
||||
renderTexture->This.Create(width, height, depthBuffer == sfTrue);
|
||||
renderTexture->Target = new sfTexture(const_cast<sf::Texture*>(&renderTexture->This.GetTexture()));
|
||||
renderTexture->DefaultView.This = renderTexture->This.GetDefaultView();
|
||||
renderTexture->CurrentView.This = renderTexture->This.GetView();
|
||||
renderTexture->This.create(width, height, depthBuffer == sfTrue);
|
||||
renderTexture->Target = new sfTexture(const_cast<sf::Texture*>(&renderTexture->This.getTexture()));
|
||||
renderTexture->DefaultView.This = renderTexture->This.getDefaultView();
|
||||
renderTexture->CurrentView.This = renderTexture->This.getView();
|
||||
|
||||
return renderTexture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_Destroy(sfRenderTexture* renderTexture)
|
||||
void sfRenderTexture_destroy(sfRenderTexture* renderTexture)
|
||||
{
|
||||
delete renderTexture->Target;
|
||||
delete renderTexture;
|
||||
@@ -60,12 +60,12 @@ void sfRenderTexture_Destroy(sfRenderTexture* renderTexture)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2u sfRenderTexture_GetSize(const sfRenderTexture* renderTexture)
|
||||
sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture)
|
||||
{
|
||||
sfVector2u size = {0, 0};
|
||||
CSFML_CHECK_RETURN(renderTexture, size);
|
||||
|
||||
sf::Vector2u sfmlSize = renderTexture->This.GetSize();
|
||||
sf::Vector2u sfmlSize = renderTexture->This.getSize();
|
||||
size.x = sfmlSize.x;
|
||||
size.y = sfmlSize.y;
|
||||
|
||||
@@ -74,39 +74,39 @@ sfVector2u sfRenderTexture_GetSize(const sfRenderTexture* renderTexture)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderTexture_SetActive(sfRenderTexture* renderTexture, sfBool active)
|
||||
sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active)
|
||||
{
|
||||
CSFML_CALL_RETURN(renderTexture, SetActive(active == sfTrue), sfFalse);
|
||||
CSFML_CALL_RETURN(renderTexture, setActive(active == sfTrue), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_Display(sfRenderTexture* renderTexture)
|
||||
void sfRenderTexture_display(sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL(renderTexture, Display());
|
||||
CSFML_CALL(renderTexture, display());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_Clear(sfRenderTexture* renderTexture, sfColor color)
|
||||
void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color)
|
||||
{
|
||||
sf::Color SFMLColor(color.r, color.g, color.b, color.a);
|
||||
|
||||
CSFML_CALL(renderTexture, Clear(SFMLColor));
|
||||
CSFML_CALL(renderTexture, clear(SFMLColor));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_SetView(sfRenderTexture* renderTexture, const sfView* view)
|
||||
void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view)
|
||||
{
|
||||
CSFML_CHECK(view);
|
||||
CSFML_CALL(renderTexture, SetView(view->This));
|
||||
CSFML_CALL(renderTexture, setView(view->This));
|
||||
renderTexture->CurrentView.This = view->This;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfView* sfRenderTexture_GetView(const sfRenderTexture* renderTexture)
|
||||
const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderTexture, NULL);
|
||||
|
||||
@@ -115,7 +115,7 @@ const sfView* sfRenderTexture_GetView(const sfRenderTexture* renderTexture)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfView* sfRenderTexture_GetDefaultView(const sfRenderTexture* renderTexture)
|
||||
const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderTexture, NULL);
|
||||
|
||||
@@ -124,32 +124,32 @@ const sfView* sfRenderTexture_GetDefaultView(const sfRenderTexture* renderTextur
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfRenderTexture_GetViewport(const sfRenderTexture* renderTexture, const sfView* view)
|
||||
sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(view, rect);
|
||||
CSFML_CHECK_RETURN(renderTexture, rect);
|
||||
|
||||
sf::IntRect SFMLrect = renderTexture->This.GetViewport(view->This);
|
||||
rect.Left = SFMLrect.Left;
|
||||
rect.Top = SFMLrect.Top;
|
||||
rect.Width = SFMLrect.Width;
|
||||
rect.Height = SFMLrect.Height;
|
||||
sf::IntRect SFMLrect = renderTexture->This.getViewport(view->This);
|
||||
rect.left = SFMLrect.left;
|
||||
rect.top = SFMLrect.top;
|
||||
rect.width = SFMLrect.width;
|
||||
rect.height = SFMLrect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_ConvertCoords(const sfRenderTexture* renderTexture, unsigned int textureX, unsigned int textureY, float* viewX, float* viewY, const sfView* targetView)
|
||||
void sfRenderTexture_convertCoords(const sfRenderTexture* renderTexture, unsigned int textureX, unsigned int textureY, float* viewX, float* viewY, const sfView* targetView)
|
||||
{
|
||||
CSFML_CHECK(renderTexture);
|
||||
|
||||
sf::Vector2f point;
|
||||
if (targetView)
|
||||
point = renderTexture->This.ConvertCoords(textureX, textureY, targetView->This);
|
||||
point = renderTexture->This.convertCoords(textureX, textureY, targetView->This);
|
||||
else
|
||||
point = renderTexture->This.ConvertCoords(textureX, textureY);
|
||||
point = renderTexture->This.convertCoords(textureX, textureY);
|
||||
|
||||
if (viewX) *viewX = point.x;
|
||||
if (viewY) *viewY = point.y;
|
||||
@@ -157,76 +157,76 @@ void sfRenderTexture_ConvertCoords(const sfRenderTexture* renderTexture, unsigne
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_DrawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderTexture_DrawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderTexture_DrawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderTexture_DrawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderTexture_DrawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderTexture_DrawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderTexture_DrawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_DrawPrimitives(sfRenderTexture* renderTexture,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states)
|
||||
void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CALL(renderTexture, Draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount,
|
||||
static_cast<sf::PrimitiveType>(type), ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderTexture, draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount,
|
||||
static_cast<sf::PrimitiveType>(type), convertRenderStates(states)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_PushGLStates(sfRenderTexture* renderTexture)
|
||||
void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL(renderTexture, PushGLStates());
|
||||
CSFML_CALL(renderTexture, pushGLStates());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_PopGLStates(sfRenderTexture* renderTexture)
|
||||
void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL(renderTexture, PopGLStates());
|
||||
CSFML_CALL(renderTexture, popGLStates());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_ResetGLStates(sfRenderTexture* renderTexture)
|
||||
void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL(renderTexture, ResetGLStates());
|
||||
CSFML_CALL(renderTexture, resetGLStates());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfRenderTexture_GetTexture(const sfRenderTexture* renderTexture)
|
||||
const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderTexture, NULL);
|
||||
|
||||
@@ -235,14 +235,14 @@ const sfTexture* sfRenderTexture_GetTexture(const sfRenderTexture* renderTexture
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_SetSmooth(sfRenderTexture* renderTexture, sfBool smooth)
|
||||
void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth)
|
||||
{
|
||||
CSFML_CALL(renderTexture, SetSmooth(smooth == sfTrue));
|
||||
CSFML_CALL(renderTexture, setSmooth(smooth == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderTexture_IsSmooth(const sfRenderTexture* renderTexture)
|
||||
sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL_RETURN(renderTexture, IsSmooth(), sfFalse);
|
||||
CSFML_CALL_RETURN(renderTexture, isSmooth(), sfFalse);
|
||||
}
|
||||
+109
-109
@@ -41,141 +41,143 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings)
|
||||
sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings)
|
||||
{
|
||||
// Convert video mode
|
||||
sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel);
|
||||
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
|
||||
|
||||
// Convert context settings
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.DepthBits = settings->DepthBits;
|
||||
params.StencilBits = settings->StencilBits;
|
||||
params.AntialiasingLevel = settings->AntialiasingLevel;
|
||||
params.MajorVersion = settings->MajorVersion;
|
||||
params.MinorVersion = settings->MinorVersion;
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
}
|
||||
|
||||
// Create the window
|
||||
sfRenderWindow* renderWindow = new sfRenderWindow;
|
||||
renderWindow->This.Create(videoMode, title, style, params);
|
||||
renderWindow->DefaultView.This = renderWindow->This.GetDefaultView();
|
||||
renderWindow->CurrentView.This = renderWindow->This.GetView();
|
||||
renderWindow->This.create(videoMode, title, style, params);
|
||||
renderWindow->DefaultView.This = renderWindow->This.getDefaultView();
|
||||
renderWindow->CurrentView.This = renderWindow->This.getView();
|
||||
|
||||
return renderWindow;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings)
|
||||
sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings)
|
||||
{
|
||||
// Convert context settings
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.DepthBits = settings->DepthBits;
|
||||
params.StencilBits = settings->StencilBits;
|
||||
params.AntialiasingLevel = settings->AntialiasingLevel;
|
||||
params.MajorVersion = settings->MajorVersion;
|
||||
params.MinorVersion = settings->MinorVersion;
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
}
|
||||
|
||||
// Create the window
|
||||
sfRenderWindow* renderWindow = new sfRenderWindow;
|
||||
renderWindow->This.Create(handle, params);
|
||||
renderWindow->DefaultView.This = renderWindow->This.GetDefaultView();
|
||||
renderWindow->CurrentView.This = renderWindow->This.GetView();
|
||||
renderWindow->This.create(handle, params);
|
||||
renderWindow->DefaultView.This = renderWindow->This.getDefaultView();
|
||||
renderWindow->CurrentView.This = renderWindow->This.getView();
|
||||
|
||||
return renderWindow;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_Destroy(sfRenderWindow* renderWindow)
|
||||
void sfRenderWindow_destroy(sfRenderWindow* renderWindow)
|
||||
{
|
||||
delete renderWindow;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_Close(sfRenderWindow* renderWindow)
|
||||
void sfRenderWindow_close(sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CALL(renderWindow, Close());
|
||||
CSFML_CALL(renderWindow, close());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderWindow_IsOpen(const sfRenderWindow* renderWindow)
|
||||
sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CALL_RETURN(renderWindow, IsOpen(), sfFalse);
|
||||
CSFML_CALL_RETURN(renderWindow, isOpen(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfContextSettings sfRenderWindow_GetSettings(const sfRenderWindow* renderWindow)
|
||||
sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
sfContextSettings settings = {0, 0, 0, 2, 0};
|
||||
CSFML_CHECK_RETURN(renderWindow, settings);
|
||||
|
||||
const sf::ContextSettings& params = renderWindow->This.GetSettings();
|
||||
settings.DepthBits = params.DepthBits;
|
||||
settings.StencilBits = params.StencilBits;
|
||||
settings.AntialiasingLevel = params.AntialiasingLevel;
|
||||
const sf::ContextSettings& params = renderWindow->This.getSettings();
|
||||
settings.depthBits = params.depthBits;
|
||||
settings.stencilBits = params.stencilBits;
|
||||
settings.antialiasingLevel = params.antialiasingLevel;
|
||||
settings.majorVersion = params.majorVersion;
|
||||
settings.minorVersion = params.minorVersion;
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderWindow_PollEvent(sfRenderWindow* renderWindow, sfEvent* event)
|
||||
sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, sfFalse);
|
||||
CSFML_CHECK_RETURN(event, sfFalse);
|
||||
|
||||
// Get the event
|
||||
sf::Event SFMLEvent;
|
||||
sfBool ret = renderWindow->This.PollEvent(SFMLEvent);
|
||||
sfBool ret = renderWindow->This.pollEvent(SFMLEvent);
|
||||
|
||||
// No event, return
|
||||
if (!ret)
|
||||
return sfFalse;
|
||||
|
||||
// Convert the sf::Event event to a sfEvent
|
||||
ConvertEvent(SFMLEvent, event);
|
||||
convertEvent(SFMLEvent, event);
|
||||
|
||||
return sfTrue;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderWindow_WaitEvent(sfRenderWindow* renderWindow, sfEvent* event)
|
||||
sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, sfFalse);
|
||||
CSFML_CHECK_RETURN(event, sfFalse);
|
||||
|
||||
// Get the event
|
||||
sf::Event SFMLEvent;
|
||||
sfBool ret = renderWindow->This.WaitEvent(SFMLEvent);
|
||||
sfBool ret = renderWindow->This.waitEvent(SFMLEvent);
|
||||
|
||||
// Error, return
|
||||
if (!ret)
|
||||
return sfFalse;
|
||||
|
||||
// Convert the sf::Event event to a sfEvent
|
||||
ConvertEvent(SFMLEvent, event);
|
||||
convertEvent(SFMLEvent, event);
|
||||
|
||||
return sfTrue;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2i sfRenderWindow_GetPosition(const sfRenderWindow* renderWindow)
|
||||
sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
sfVector2i position = {0, 0};
|
||||
CSFML_CHECK_RETURN(renderWindow, position);
|
||||
|
||||
sf::Vector2i sfmlPos = renderWindow->This.GetPosition();
|
||||
sf::Vector2i sfmlPos = renderWindow->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -184,19 +186,19 @@ sfVector2i sfRenderWindow_GetPosition(const sfRenderWindow* renderWindow)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetPosition(sfRenderWindow* renderWindow, sfVector2i position)
|
||||
void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetPosition(sf::Vector2i(position.x, position.y)));
|
||||
CSFML_CALL(renderWindow, setPosition(sf::Vector2i(position.x, position.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2u sfRenderWindow_GetSize(const sfRenderWindow* renderWindow)
|
||||
sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
sfVector2u size = {0, 0};
|
||||
CSFML_CHECK_RETURN(renderWindow, size);
|
||||
|
||||
sf::Vector2u sfmlSize = renderWindow->This.GetSize();
|
||||
sf::Vector2u sfmlSize = renderWindow->This.getSize();
|
||||
size.x = sfmlSize.x;
|
||||
size.y = sfmlSize.y;
|
||||
|
||||
@@ -205,111 +207,111 @@ sfVector2u sfRenderWindow_GetSize(const sfRenderWindow* renderWindow)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetSize(sfRenderWindow* renderWindow, sfVector2u size)
|
||||
void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetSize(sf::Vector2u(size.x, size.y)));
|
||||
CSFML_CALL(renderWindow, setSize(sf::Vector2u(size.x, size.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetTitle(sfRenderWindow* renderWindow, const char* title)
|
||||
void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetTitle(title));
|
||||
CSFML_CALL(renderWindow, setTitle(title));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels)
|
||||
void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetIcon(width, height, pixels));
|
||||
CSFML_CALL(renderWindow, setIcon(width, height, pixels));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetVisible(sfRenderWindow* renderWindow, sfBool visible)
|
||||
void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetVisible(visible == sfTrue));
|
||||
CSFML_CALL(renderWindow, setVisible(visible == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetMouseCursorVisible(sfRenderWindow* renderWindow, sfBool visible)
|
||||
void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool visible)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetMouseCursorVisible(visible == sfTrue));
|
||||
CSFML_CALL(renderWindow, setMouseCursorVisible(visible == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled)
|
||||
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetVerticalSyncEnabled(enabled == sfTrue));
|
||||
CSFML_CALL(renderWindow, setVerticalSyncEnabled(enabled == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled)
|
||||
void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetKeyRepeatEnabled(enabled == sfTrue));
|
||||
CSFML_CALL(renderWindow, setKeyRepeatEnabled(enabled == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderWindow_SetActive(sfRenderWindow* renderWindow, sfBool active)
|
||||
sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active)
|
||||
{
|
||||
CSFML_CALL_RETURN(renderWindow, SetActive(active == sfTrue), sfFalse);
|
||||
CSFML_CALL_RETURN(renderWindow, setActive(active == sfTrue), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_Display(sfRenderWindow* renderWindow)
|
||||
void sfRenderWindow_display(sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CALL(renderWindow, Display());
|
||||
CSFML_CALL(renderWindow, display());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit)
|
||||
void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetFramerateLimit(limit));
|
||||
CSFML_CALL(renderWindow, setFramerateLimit(limit));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* renderWindow, float threshold)
|
||||
void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold)
|
||||
{
|
||||
CSFML_CALL(renderWindow, SetJoystickThreshold(threshold));
|
||||
CSFML_CALL(renderWindow, setJoystickThreshold(threshold));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfWindowHandle sfRenderWindow_GetSystemHandle(const sfRenderWindow* renderWindow)
|
||||
sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, 0);
|
||||
|
||||
return (sfWindowHandle)renderWindow->This.GetSystemHandle();
|
||||
return (sfWindowHandle)renderWindow->This.getSystemHandle();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfColor color)
|
||||
void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color)
|
||||
{
|
||||
sf::Color SFMLColor(color.r, color.g, color.b, color.a);
|
||||
|
||||
CSFML_CALL(renderWindow, Clear(SFMLColor));
|
||||
CSFML_CALL(renderWindow, clear(SFMLColor));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_SetView(sfRenderWindow* renderWindow, const sfView* view)
|
||||
void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view)
|
||||
{
|
||||
CSFML_CHECK(view);
|
||||
CSFML_CALL(renderWindow, SetView(view->This));
|
||||
CSFML_CALL(renderWindow, setView(view->This));
|
||||
renderWindow->CurrentView.This = view->This;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow)
|
||||
const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, NULL);
|
||||
|
||||
@@ -318,7 +320,7 @@ const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfView* sfRenderWindow_GetDefaultView(const sfRenderWindow* renderWindow)
|
||||
const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, NULL);
|
||||
|
||||
@@ -327,32 +329,32 @@ const sfView* sfRenderWindow_GetDefaultView(const sfRenderWindow* renderWindow)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfRenderWindow_GetViewport(const sfRenderWindow* renderWindow, const sfView* view)
|
||||
sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(view, rect);
|
||||
CSFML_CHECK_RETURN(renderWindow, rect);
|
||||
|
||||
sf::IntRect SFMLrect = renderWindow->This.GetViewport(view->This);
|
||||
rect.Left = SFMLrect.Left;
|
||||
rect.Top = SFMLrect.Top;
|
||||
rect.Width = SFMLrect.Width;
|
||||
rect.Height = SFMLrect.Height;
|
||||
sf::IntRect SFMLrect = renderWindow->This.getViewport(view->This);
|
||||
rect.left = SFMLrect.left;
|
||||
rect.top = SFMLrect.top;
|
||||
rect.width = SFMLrect.width;
|
||||
rect.height = SFMLrect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView)
|
||||
void sfRenderWindow_convertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView)
|
||||
{
|
||||
CSFML_CHECK(renderWindow);
|
||||
|
||||
sf::Vector2f point;
|
||||
if (targetView)
|
||||
point = renderWindow->This.ConvertCoords(windowX, windowY, targetView->This);
|
||||
point = renderWindow->This.convertCoords(windowX, windowY, targetView->This);
|
||||
else
|
||||
point = renderWindow->This.ConvertCoords(windowX, windowY);
|
||||
point = renderWindow->This.convertCoords(windowX, windowY);
|
||||
|
||||
if (viewX) *viewX = point.x;
|
||||
if (viewY) *viewY = point.y;
|
||||
@@ -360,83 +362,81 @@ void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned i
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderWindow_DrawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderWindow_DrawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderWindow_DrawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderWindow_DrawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderWindow_DrawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
void sfRenderWindow_DrawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CHECK(object);
|
||||
CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_DrawPrimitives(sfRenderWindow* renderWindow,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states)
|
||||
void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CALL(renderWindow, Draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount,
|
||||
static_cast<sf::PrimitiveType>(type), ConvertRenderStates(states)));
|
||||
CSFML_CALL(renderWindow, draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount,
|
||||
static_cast<sf::PrimitiveType>(type), convertRenderStates(states)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_PushGLStates(sfRenderWindow* renderWindow)
|
||||
void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CALL(renderWindow, PushGLStates());
|
||||
CSFML_CALL(renderWindow, pushGLStates());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_PopGLStates(sfRenderWindow* renderWindow)
|
||||
void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CALL(renderWindow, PopGLStates());
|
||||
CSFML_CALL(renderWindow, popGLStates());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_ResetGLStates(sfRenderWindow* renderWindow)
|
||||
void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CALL(renderWindow, ResetGLStates());
|
||||
CSFML_CALL(renderWindow, resetGLStates());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Copy the current contents of a window to an image
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfRenderWindow_Capture(const sfRenderWindow* renderWindow)
|
||||
sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, NULL);
|
||||
|
||||
sfImage* image = new sfImage;
|
||||
image->This = renderWindow->This.Capture();
|
||||
image->This = renderWindow->This.capture();
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename)
|
||||
sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename)
|
||||
{
|
||||
bool success = false;
|
||||
sfShader* shader = new sfShader;
|
||||
@@ -43,17 +43,17 @@ sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char*
|
||||
if (!vertexShaderFilename)
|
||||
{
|
||||
// fragment shader only
|
||||
success = shader->This.LoadFromFile(fragmentShaderFilename, sf::Shader::Fragment);
|
||||
success = shader->This.loadFromFile(fragmentShaderFilename, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShaderFilename)
|
||||
{
|
||||
// vertex shader only
|
||||
success = shader->This.LoadFromFile(vertexShaderFilename, sf::Shader::Vertex);
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, sf::Shader::Vertex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
success = shader->This.LoadFromFile(vertexShaderFilename, fragmentShaderFilename);
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, fragmentShaderFilename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char*
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragmentShader)
|
||||
sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader)
|
||||
{
|
||||
bool success = false;
|
||||
sfShader* shader = new sfShader;
|
||||
@@ -77,17 +77,17 @@ sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragme
|
||||
if (!vertexShader)
|
||||
{
|
||||
// fragment shader only
|
||||
success = shader->This.LoadFromMemory(fragmentShader, sf::Shader::Fragment);
|
||||
success = shader->This.loadFromMemory(fragmentShader, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShader)
|
||||
{
|
||||
// vertex shader only
|
||||
success = shader->This.LoadFromMemory(vertexShader, sf::Shader::Vertex);
|
||||
success = shader->This.loadFromMemory(vertexShader, sf::Shader::Vertex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
success = shader->This.LoadFromMemory(vertexShader, fragmentShader);
|
||||
success = shader->This.loadFromMemory(vertexShader, fragmentShader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragme
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream)
|
||||
sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream)
|
||||
{
|
||||
bool success = false;
|
||||
sfShader* shader = new sfShader;
|
||||
@@ -112,20 +112,20 @@ sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputSt
|
||||
{
|
||||
// fragment shader only
|
||||
CallbackStream stream(fragmentShaderStream);
|
||||
success = shader->This.LoadFromStream(stream, sf::Shader::Fragment);
|
||||
success = shader->This.loadFromStream(stream, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShaderStream)
|
||||
{
|
||||
// vertex shader only
|
||||
CallbackStream stream(vertexShaderStream);
|
||||
success = shader->This.LoadFromStream(stream, sf::Shader::Vertex);
|
||||
success = shader->This.loadFromStream(stream, sf::Shader::Vertex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
CallbackStream vertexStream(vertexShaderStream);
|
||||
CallbackStream fragmentStream(fragmentShaderStream);
|
||||
success = shader->This.LoadFromStream(vertexStream, fragmentStream);
|
||||
success = shader->This.loadFromStream(vertexStream, fragmentStream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,85 +140,99 @@ sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputSt
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_Destroy(sfShader* shader)
|
||||
void sfShader_destroy(sfShader* shader)
|
||||
{
|
||||
delete shader;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetFloatParameter(sfShader* shader, const char* name, float x)
|
||||
void sfShader_setFloatParameter(sfShader* shader, const char* name, float x)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, x));
|
||||
CSFML_CALL(shader, setParameter(name, x));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetFloat2Parameter(sfShader* shader, const char* name, float x, float y)
|
||||
void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, x, y));
|
||||
CSFML_CALL(shader, setParameter(name, x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z)
|
||||
void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, x, y, z));
|
||||
CSFML_CALL(shader, setParameter(name, x, y, z));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w)
|
||||
void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, x, y, z, w));
|
||||
CSFML_CALL(shader, setParameter(name, x, y, z, w));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetColorParameter(sfShader* shader, const char* name, sfColor color)
|
||||
void sfShader_SetVector2Parameter(sfShader* shader, const char* name, sfVector2f vector)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Vector2f(vector.x, vector.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetTransformParameter(sfShader* shader, const char* name, const sfTransform* transform)
|
||||
void sfShader_SetVector3Parameter(sfShader* shader, const char* name, sfVector3f vector)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, transform ? transform->This : sf::Transform::Identity));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Vector3f(vector.x, vector.y, vector.z)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetTextureParameter(sfShader* shader, const char* name, const sfTexture* texture)
|
||||
void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setTransformParameter(sfShader* shader, const char* name, const sfTransform* transform)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, transform ? transform->This : sf::Transform::Identity));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture)
|
||||
{
|
||||
CSFML_CHECK(texture);
|
||||
CSFML_CALL(shader, SetParameter(name, *texture->This));
|
||||
CSFML_CALL(shader, setParameter(name, *texture->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_SetCurrentTextureParameter(sfShader* shader, const char* name)
|
||||
void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name)
|
||||
{
|
||||
CSFML_CALL(shader, SetParameter(name, sf::Shader::CurrentTexture));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Shader::CurrentTexture));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_Bind(const sfShader* shader)
|
||||
void sfShader_bind(const sfShader* shader)
|
||||
{
|
||||
CSFML_CALL(shader, Bind());
|
||||
CSFML_CALL(shader, bind());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_Unbind(const sfShader* shader)
|
||||
void sfShader_unbind(const sfShader* shader)
|
||||
{
|
||||
CSFML_CALL(shader, Unbind());
|
||||
CSFML_CALL(shader, unbind());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfShader_IsAvailable(void)
|
||||
sfBool sfShader_isAvailable(void)
|
||||
{
|
||||
return sf::Shader::IsAvailable() ? sfTrue : sfFalse;
|
||||
return sf::Shader::isAvailable() ? sfTrue : sfFalse;
|
||||
}
|
||||
+69
-69
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShape* sfShape_Create(sfShapeGetPointCountCallback getPointCount,
|
||||
sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount,
|
||||
sfShapeGetPointCallback getPoint,
|
||||
void* userData)
|
||||
{
|
||||
@@ -41,47 +41,47 @@ sfShape* sfShape_Create(sfShapeGetPointCountCallback getPointCount,
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_Destroy(sfShape* shape)
|
||||
void sfShape_destroy(sfShape* shape)
|
||||
{
|
||||
delete shape;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetPosition(sfShape* shape, sfVector2f position)
|
||||
void sfShape_setPosition(sfShape* shape, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(shape, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(shape, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetRotation(sfShape* shape, float angle)
|
||||
void sfShape_setRotation(sfShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, SetRotation(angle));
|
||||
CSFML_CALL(shape, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetScale(sfShape* shape, sfVector2f scale)
|
||||
void sfShape_setScale(sfShape* shape, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(shape, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(shape, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetOrigin(sfShape* shape, sfVector2f origin)
|
||||
void sfShape_setOrigin(sfShape* shape, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(shape, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(shape, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfShape_GetPosition(const sfShape* shape)
|
||||
sfVector2f sfShape_getPosition(const sfShape* shape)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, position);
|
||||
|
||||
sf::Vector2f sfmlPos = shape->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = shape->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -90,19 +90,19 @@ sfVector2f sfShape_GetPosition(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfShape_GetRotation(const sfShape* shape)
|
||||
float sfShape_getRotation(const sfShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfShape_GetScale(const sfShape* shape)
|
||||
sfVector2f sfShape_getScale(const sfShape* shape)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = shape->This.GetScale();
|
||||
sf::Vector2f sfmlScale = shape->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -111,12 +111,12 @@ sfVector2f sfShape_GetScale(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfShape_GetOrigin(const sfShape* shape)
|
||||
sfVector2f sfShape_getOrigin(const sfShape* shape)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = shape->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = shape->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -125,84 +125,84 @@ sfVector2f sfShape_GetOrigin(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_Move(sfShape* shape, sfVector2f offset)
|
||||
void sfShape_move(sfShape* shape, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(shape, Move(offset.x, offset.y));
|
||||
CSFML_CALL(shape, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_Rotate(sfShape* shape, float angle)
|
||||
void sfShape_rotate(sfShape* shape, float angle)
|
||||
{
|
||||
CSFML_CALL(shape, Rotate(angle));
|
||||
CSFML_CALL(shape, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_Scale(sfShape* shape, sfVector2f factors)
|
||||
void sfShape_scale(sfShape* shape, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(shape, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(shape, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfShape_GetTransform(const sfShape* shape)
|
||||
const sfTransform* sfShape_getTransform(const sfShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->Transform.This = shape->This.GetTransform();
|
||||
shape->Transform.This = shape->This.getTransform();
|
||||
return &shape->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfShape_GetInverseTransform(const sfShape* shape)
|
||||
const sfTransform* sfShape_getInverseTransform(const sfShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
shape->InverseTransform.This = shape->This.GetInverseTransform();
|
||||
shape->InverseTransform.This = shape->This.getInverseTransform();
|
||||
return &shape->InverseTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
void sfShape_setTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue));
|
||||
shape->Texture = texture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetTextureRect(sfShape* shape, sfIntRect rect)
|
||||
void sfShape_setTextureRect(sfShape* shape, sfIntRect rect)
|
||||
{
|
||||
CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height)));
|
||||
CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetFillColor(sfShape* shape, sfColor color)
|
||||
void sfShape_setFillColor(sfShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetOutlineColor(sfShape* shape, sfColor color)
|
||||
void sfShape_setOutlineColor(sfShape* shape, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_SetOutlineThickness(sfShape* shape, float thickness)
|
||||
void sfShape_setOutlineThickness(sfShape* shape, float thickness)
|
||||
{
|
||||
CSFML_CALL(shape, SetOutlineThickness(thickness));
|
||||
CSFML_CALL(shape, setOutlineThickness(thickness));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfShape_GetTexture(const sfShape* shape)
|
||||
const sfTexture* sfShape_getTexture(const sfShape* shape)
|
||||
{
|
||||
CSFML_CHECK_RETURN(shape, NULL);
|
||||
|
||||
@@ -211,28 +211,28 @@ const sfTexture* sfShape_GetTexture(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfShape_GetTextureRect(const sfShape* shape)
|
||||
sfIntRect sfShape_getTextureRect(const sfShape* shape)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::IntRect sfmlRect = shape->This.GetTextureRect();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::IntRect sfmlRect = shape->This.getTextureRect();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfShape_GetFillColor(const sfShape* shape)
|
||||
sfColor sfShape_getFillColor(const sfShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetFillColor();
|
||||
sf::Color sfmlColor = shape->This.getFillColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -243,12 +243,12 @@ sfColor sfShape_GetFillColor(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfShape_GetOutlineColor(const sfShape* shape)
|
||||
sfColor sfShape_getOutlineColor(const sfShape* shape)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, color);
|
||||
|
||||
sf::Color sfmlColor = shape->This.GetOutlineColor();
|
||||
sf::Color sfmlColor = shape->This.getOutlineColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -259,26 +259,26 @@ sfColor sfShape_GetOutlineColor(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfShape_GetOutlineThickness(const sfShape* shape)
|
||||
float sfShape_getOutlineThickness(const sfShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f);
|
||||
CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfShape_GetPointCount(const sfShape* shape)
|
||||
unsigned int sfShape_getPointCount(const sfShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, GetPointCount(), 0);
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfShape_GetPoint(const sfShape* shape, unsigned int index)
|
||||
sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
|
||||
sf::Vector2f sfmlPoint = shape->This.GetPoint(index);
|
||||
sf::Vector2f sfmlPoint = shape->This.getPoint(index);
|
||||
point.x = sfmlPoint.x;
|
||||
point.y = sfmlPoint.y;
|
||||
|
||||
@@ -287,39 +287,39 @@ sfVector2f sfShape_GetPoint(const sfShape* shape, unsigned int index)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfShape_GetLocalBounds(const sfShape* shape)
|
||||
sfFloatRect sfShape_getLocalBounds(const sfShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getLocalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfShape_GetGlobalBounds(const sfShape* shape)
|
||||
sfFloatRect sfShape_getGlobalBounds(const sfShape* shape)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(shape, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = shape->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = shape->This.getGlobalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShape_Update(sfShape* shape)
|
||||
void sfShape_update(sfShape* shape)
|
||||
{
|
||||
CSFML_CALL(shape, Update());
|
||||
CSFML_CALL(shape, update());
|
||||
}
|
||||
@@ -51,18 +51,18 @@ public :
|
||||
{
|
||||
}
|
||||
|
||||
virtual unsigned int GetPointCount() const
|
||||
virtual unsigned int getPointCount() const
|
||||
{
|
||||
return myGetPointCountCallback(myUserData);
|
||||
}
|
||||
|
||||
virtual sf::Vector2f GetPoint(unsigned int index) const
|
||||
virtual sf::Vector2f getPoint(unsigned int index) const
|
||||
{
|
||||
sfVector2f point = myGetPointCallback(index, myUserData);
|
||||
return sf::Vector2f(point.x, point.y);
|
||||
}
|
||||
|
||||
using sf::Shape::Update;
|
||||
using sf::Shape::update;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSprite* sfSprite_Create(void)
|
||||
sfSprite* sfSprite_create(void)
|
||||
{
|
||||
sfSprite* sprite = new sfSprite;
|
||||
sprite->Texture = NULL;
|
||||
@@ -43,7 +43,7 @@ sfSprite* sfSprite_Create(void)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSprite* sfSprite_Copy(sfSprite* sprite)
|
||||
sfSprite* sfSprite_copy(sfSprite* sprite)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sprite, NULL);
|
||||
|
||||
@@ -52,47 +52,47 @@ sfSprite* sfSprite_Copy(sfSprite* sprite)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_Destroy(sfSprite* sprite)
|
||||
void sfSprite_destroy(sfSprite* sprite)
|
||||
{
|
||||
delete sprite;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetPosition(sfSprite* sprite, sfVector2f position)
|
||||
void sfSprite_setPosition(sfSprite* sprite, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(sprite, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(sprite, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetRotation(sfSprite* sprite, float angle)
|
||||
void sfSprite_setRotation(sfSprite* sprite, float angle)
|
||||
{
|
||||
CSFML_CALL(sprite, SetRotation(angle));
|
||||
CSFML_CALL(sprite, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetScale(sfSprite* sprite, sfVector2f scale)
|
||||
void sfSprite_setScale(sfSprite* sprite, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(sprite, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(sprite, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetOrigin(sfSprite* sprite, sfVector2f origin)
|
||||
void sfSprite_setOrigin(sfSprite* sprite, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(sprite, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(sprite, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfSprite_GetPosition(const sfSprite* sprite)
|
||||
sfVector2f sfSprite_getPosition(const sfSprite* sprite)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, position);
|
||||
|
||||
sf::Vector2f sfmlPos = sprite->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = sprite->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -101,19 +101,19 @@ sfVector2f sfSprite_GetPosition(const sfSprite* sprite)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfSprite_GetRotation(const sfSprite* sprite)
|
||||
float sfSprite_getRotation(const sfSprite* sprite)
|
||||
{
|
||||
CSFML_CALL_RETURN(sprite, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(sprite, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfSprite_GetScale(const sfSprite* sprite)
|
||||
sfVector2f sfSprite_getScale(const sfSprite* sprite)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = sprite->This.GetScale();
|
||||
sf::Vector2f sfmlScale = sprite->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -122,12 +122,12 @@ sfVector2f sfSprite_GetScale(const sfSprite* sprite)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfSprite_GetOrigin(const sfSprite* sprite)
|
||||
sfVector2f sfSprite_getOrigin(const sfSprite* sprite)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = sprite->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = sprite->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -136,73 +136,73 @@ sfVector2f sfSprite_GetOrigin(const sfSprite* sprite)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_Move(sfSprite* sprite, sfVector2f offset)
|
||||
void sfSprite_move(sfSprite* sprite, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(sprite, Move(offset.x, offset.y));
|
||||
CSFML_CALL(sprite, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_Rotate(sfSprite* sprite, float angle)
|
||||
void sfSprite_rotate(sfSprite* sprite, float angle)
|
||||
{
|
||||
CSFML_CALL(sprite, Rotate(angle));
|
||||
CSFML_CALL(sprite, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_Scale(sfSprite* sprite, sfVector2f factors)
|
||||
void sfSprite_scale(sfSprite* sprite, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(sprite, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(sprite, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfSprite_GetTransform(const sfSprite* sprite)
|
||||
const sfTransform* sfSprite_getTransform(const sfSprite* sprite)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sprite, NULL);
|
||||
|
||||
sprite->Transform.This = sprite->This.GetTransform();
|
||||
sprite->Transform.This = sprite->This.getTransform();
|
||||
return &sprite->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfSprite_GetInverseTransform(const sfSprite* sprite)
|
||||
const sfTransform* sfSprite_getInverseTransform(const sfSprite* sprite)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sprite, NULL);
|
||||
|
||||
sprite->InverseTransform.This = sprite->This.GetInverseTransform();
|
||||
sprite->InverseTransform.This = sprite->This.getInverseTransform();
|
||||
return &sprite->InverseTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect)
|
||||
void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect)
|
||||
{
|
||||
if (texture && texture->This)
|
||||
{
|
||||
CSFML_CALL(sprite, SetTexture(*texture->This, resetRect == sfTrue));
|
||||
CSFML_CALL(sprite, setTexture(*texture->This, resetRect == sfTrue));
|
||||
sprite->Texture = texture;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetTextureRect(sfSprite* sprite, sfIntRect rectangle)
|
||||
void sfSprite_setTextureRect(sfSprite* sprite, sfIntRect rectangle)
|
||||
{
|
||||
CSFML_CALL(sprite, SetTextureRect(sf::IntRect(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height)));
|
||||
CSFML_CALL(sprite, setTextureRect(sf::IntRect(rectangle.left, rectangle.top, rectangle.width, rectangle.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSprite_SetColor(sfSprite* sprite, sfColor color)
|
||||
void sfSprite_setColor(sfSprite* sprite, sfColor color)
|
||||
{
|
||||
CSFML_CALL(sprite, SetColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(sprite, setColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTexture* sfSprite_GetTexture(const sfSprite* sprite)
|
||||
const sfTexture* sfSprite_getTexture(const sfSprite* sprite)
|
||||
{
|
||||
CSFML_CHECK_RETURN(sprite, NULL);
|
||||
|
||||
@@ -211,28 +211,28 @@ const sfTexture* sfSprite_GetTexture(const sfSprite* sprite)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIntRect sfSprite_GetTextureRect(const sfSprite* sprite)
|
||||
sfIntRect sfSprite_getTextureRect(const sfSprite* sprite)
|
||||
{
|
||||
sfIntRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, rect);
|
||||
|
||||
sf::IntRect sfmlRect = sprite->This.GetTextureRect();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::IntRect sfmlRect = sprite->This.getTextureRect();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfSprite_GetColor(const sfSprite* sprite)
|
||||
sfColor sfSprite_getColor(const sfSprite* sprite)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, color);
|
||||
|
||||
sf::Color sfmlColor = sprite->This.GetColor();
|
||||
sf::Color sfmlColor = sprite->This.getColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -243,32 +243,32 @@ sfColor sfSprite_GetColor(const sfSprite* sprite)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfSprite_GetLocalBounds(const sfSprite* sprite)
|
||||
sfFloatRect sfSprite_getLocalBounds(const sfSprite* sprite)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = sprite->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = sprite->This.getLocalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfSprite_GetGlobalBounds(const sfSprite* sprite)
|
||||
sfFloatRect sfSprite_getGlobalBounds(const sfSprite* sprite)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(sprite, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = sprite->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = sprite->This.getGlobalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
+67
-67
@@ -33,17 +33,17 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfText* sfText_Create(void)
|
||||
sfText* sfText_create(void)
|
||||
{
|
||||
sfText* text = new sfText;
|
||||
text->Font = sfFont_GetDefaultFont();
|
||||
text->Font = sfFont_getDefaultFont();
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfText* sfText_Copy(sfText* text)
|
||||
sfText* sfText_copy(sfText* text)
|
||||
{
|
||||
CSFML_CHECK_RETURN(text, NULL);
|
||||
|
||||
@@ -52,47 +52,47 @@ sfText* sfText_Copy(sfText* text)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_Destroy(sfText* text)
|
||||
void sfText_destroy(sfText* text)
|
||||
{
|
||||
delete text;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetPosition(sfText* text, sfVector2f position)
|
||||
void sfText_setPosition(sfText* text, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(text, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(text, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetRotation(sfText* text, float angle)
|
||||
void sfText_setRotation(sfText* text, float angle)
|
||||
{
|
||||
CSFML_CALL(text, SetRotation(angle));
|
||||
CSFML_CALL(text, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetScale(sfText* text, sfVector2f scale)
|
||||
void sfText_setScale(sfText* text, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(text, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(text, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetOrigin(sfText* text, sfVector2f origin)
|
||||
void sfText_setOrigin(sfText* text, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(text, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(text, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfText_GetPosition(const sfText* text)
|
||||
sfVector2f sfText_getPosition(const sfText* text)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(text, position);
|
||||
|
||||
sf::Vector2f sfmlPos = text->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = text->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -101,19 +101,19 @@ sfVector2f sfText_GetPosition(const sfText* text)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfText_GetRotation(const sfText* text)
|
||||
float sfText_getRotation(const sfText* text)
|
||||
{
|
||||
CSFML_CALL_RETURN(text, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(text, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfText_GetScale(const sfText* text)
|
||||
sfVector2f sfText_getScale(const sfText* text)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(text, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = text->This.GetScale();
|
||||
sf::Vector2f sfmlScale = text->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -122,12 +122,12 @@ sfVector2f sfText_GetScale(const sfText* text)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfText_GetOrigin(const sfText* text)
|
||||
sfVector2f sfText_getOrigin(const sfText* text)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(text, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = text->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = text->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -136,114 +136,114 @@ sfVector2f sfText_GetOrigin(const sfText* text)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_Move(sfText* text, sfVector2f offset)
|
||||
void sfText_move(sfText* text, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(text, Move(offset.x, offset.y));
|
||||
CSFML_CALL(text, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_Rotate(sfText* text, float angle)
|
||||
void sfText_rotate(sfText* text, float angle)
|
||||
{
|
||||
CSFML_CALL(text, Rotate(angle));
|
||||
CSFML_CALL(text, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_Scale(sfText* text, sfVector2f factors)
|
||||
void sfText_scale(sfText* text, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(text, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(text, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfText_GetTransform(const sfText* text)
|
||||
const sfTransform* sfText_getTransform(const sfText* text)
|
||||
{
|
||||
CSFML_CHECK_RETURN(text, NULL);
|
||||
|
||||
text->Transform.This = text->This.GetTransform();
|
||||
text->Transform.This = text->This.getTransform();
|
||||
return &text->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfText_GetInverseTransform(const sfText* text)
|
||||
const sfTransform* sfText_getInverseTransform(const sfText* text)
|
||||
{
|
||||
CSFML_CHECK_RETURN(text, NULL);
|
||||
|
||||
text->InverseTransform.This = text->This.GetInverseTransform();
|
||||
text->InverseTransform.This = text->This.getInverseTransform();
|
||||
return &text->InverseTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetString(sfText* text, const char* string)
|
||||
void sfText_setString(sfText* text, const char* string)
|
||||
{
|
||||
CSFML_CALL(text, SetString(string));
|
||||
CSFML_CALL(text, setString(string));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetUnicodeString(sfText* text, const sfUint32* string)
|
||||
void sfText_setUnicodeString(sfText* text, const sfUint32* string)
|
||||
{
|
||||
sf::String UTF32Text = string;
|
||||
CSFML_CALL(text, SetString(UTF32Text));
|
||||
CSFML_CALL(text, setString(UTF32Text));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetFont(sfText* text, const sfFont* font)
|
||||
void sfText_setFont(sfText* text, const sfFont* font)
|
||||
{
|
||||
CSFML_CHECK(font);
|
||||
|
||||
CSFML_CALL(text, SetFont(font->This));
|
||||
CSFML_CALL(text, setFont(font->This));
|
||||
text->Font = font;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetCharacterSize(sfText* text, unsigned int size)
|
||||
void sfText_setCharacterSize(sfText* text, unsigned int size)
|
||||
{
|
||||
CSFML_CALL(text, SetCharacterSize(size));
|
||||
CSFML_CALL(text, setCharacterSize(size));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetStyle(sfText* text, sfUint32 style)
|
||||
void sfText_setStyle(sfText* text, sfUint32 style)
|
||||
{
|
||||
CSFML_CALL(text, SetStyle(style));
|
||||
CSFML_CALL(text, setStyle(style));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_SetColor(sfText* text, sfColor color)
|
||||
void sfText_setColor(sfText* text, sfColor color)
|
||||
{
|
||||
CSFML_CALL(text, SetColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(text, setColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfText_GetString(const sfText* text)
|
||||
const char* sfText_getString(const sfText* text)
|
||||
{
|
||||
CSFML_CHECK_RETURN(text, NULL);
|
||||
|
||||
text->String = text->This.GetString().ToAnsiString();
|
||||
text->String = text->This.getString().toAnsiString();
|
||||
|
||||
return text->String.c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfUint32* sfText_GetUnicodeString(const sfText* text)
|
||||
const sfUint32* sfText_getUnicodeString(const sfText* text)
|
||||
{
|
||||
CSFML_CHECK_RETURN(text, NULL);
|
||||
|
||||
return text->This.GetString().GetData();
|
||||
return text->This.getString().getData();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfFont* sfText_GetFont(const sfText* text)
|
||||
const sfFont* sfText_getFont(const sfText* text)
|
||||
{
|
||||
CSFML_CHECK_RETURN(text, NULL);
|
||||
|
||||
@@ -252,26 +252,26 @@ const sfFont* sfText_GetFont(const sfText* text)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfText_GetCharacterSize(const sfText* text)
|
||||
unsigned int sfText_getCharacterSize(const sfText* text)
|
||||
{
|
||||
CSFML_CALL_RETURN(text, GetCharacterSize(), 0);
|
||||
CSFML_CALL_RETURN(text, getCharacterSize(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfUint32 sfText_GetStyle(const sfText* text)
|
||||
sfUint32 sfText_getStyle(const sfText* text)
|
||||
{
|
||||
CSFML_CALL_RETURN(text, GetStyle(), 0);
|
||||
CSFML_CALL_RETURN(text, getStyle(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfText_GetColor(const sfText* text)
|
||||
sfColor sfText_getColor(const sfText* text)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(text, color);
|
||||
|
||||
sf::Color sfmlColor = text->This.GetColor();
|
||||
sf::Color sfmlColor = text->This.getColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -282,12 +282,12 @@ sfColor sfText_GetColor(const sfText* text)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfText_FindCharacterPos(const sfText* text, size_t index)
|
||||
sfVector2f sfText_findCharacterPos(const sfText* text, size_t index)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(text, position);
|
||||
|
||||
sf::Vector2f sfmlPos = text->This.FindCharacterPos(index);
|
||||
sf::Vector2f sfmlPos = text->This.findCharacterPos(index);
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -296,32 +296,32 @@ sfVector2f sfText_FindCharacterPos(const sfText* text, size_t index)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfText_GetLocalBounds(const sfText* text)
|
||||
sfFloatRect sfText_getLocalBounds(const sfText* text)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(text, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = text->This.GetLocalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = text->This.getLocalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfText_GetGlobalBounds(const sfText* text)
|
||||
sfFloatRect sfText_getGlobalBounds(const sfText* text)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(text, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = text->This.GetGlobalBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = text->This.getGlobalBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
@@ -35,11 +35,11 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTexture* sfTexture_Create(unsigned int width, unsigned int height)
|
||||
sfTexture* sfTexture_create(unsigned int width, unsigned int height)
|
||||
{
|
||||
sfTexture* texture = new sfTexture;
|
||||
|
||||
if (!texture->This->Create(width, height))
|
||||
if (!texture->This->create(width, height))
|
||||
{
|
||||
delete texture;
|
||||
texture = NULL;
|
||||
@@ -50,15 +50,15 @@ sfTexture* sfTexture_Create(unsigned int width, unsigned int height)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTexture* sfTexture_CreateFromFile(const char* filename, const sfIntRect* area)
|
||||
sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area)
|
||||
{
|
||||
sfTexture* texture = new sfTexture;
|
||||
|
||||
sf::IntRect rect;
|
||||
if (area)
|
||||
rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height);
|
||||
rect = sf::IntRect(area->left, area->top, area->width, area->height);
|
||||
|
||||
if (!texture->This->LoadFromFile(filename, rect))
|
||||
if (!texture->This->loadFromFile(filename, rect))
|
||||
{
|
||||
delete texture;
|
||||
texture = NULL;
|
||||
@@ -69,15 +69,15 @@ sfTexture* sfTexture_CreateFromFile(const char* filename, const sfIntRect* area)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTexture* sfTexture_CreateFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area)
|
||||
sfTexture* sfTexture_createFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area)
|
||||
{
|
||||
sfTexture* texture = new sfTexture;
|
||||
|
||||
sf::IntRect rect;
|
||||
if (area)
|
||||
rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height);
|
||||
rect = sf::IntRect(area->left, area->top, area->width, area->height);
|
||||
|
||||
if (!texture->This->LoadFromMemory(data, sizeInBytes, rect))
|
||||
if (!texture->This->loadFromMemory(data, sizeInBytes, rect))
|
||||
{
|
||||
delete texture;
|
||||
texture = NULL;
|
||||
@@ -88,7 +88,7 @@ sfTexture* sfTexture_CreateFromMemory(const void* data, size_t sizeInBytes, cons
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* area)
|
||||
sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area)
|
||||
{
|
||||
CSFML_CHECK_RETURN(stream, NULL);
|
||||
|
||||
@@ -96,10 +96,10 @@ sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* ar
|
||||
|
||||
sf::IntRect rect;
|
||||
if (area)
|
||||
rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height);
|
||||
rect = sf::IntRect(area->left, area->top, area->width, area->height);
|
||||
|
||||
CallbackStream sfmlStream(stream);
|
||||
if (!texture->This->LoadFromStream(sfmlStream, rect))
|
||||
if (!texture->This->loadFromStream(sfmlStream, rect))
|
||||
{
|
||||
delete texture;
|
||||
texture = NULL;
|
||||
@@ -110,7 +110,7 @@ sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* ar
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area)
|
||||
sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area)
|
||||
{
|
||||
CSFML_CHECK_RETURN(image, NULL);
|
||||
|
||||
@@ -118,9 +118,9 @@ sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area
|
||||
|
||||
sf::IntRect rect;
|
||||
if (area)
|
||||
rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height);
|
||||
rect = sf::IntRect(area->left, area->top, area->width, area->height);
|
||||
|
||||
if (!texture->This->LoadFromImage(image->This, rect))
|
||||
if (!texture->This->loadFromImage(image->This, rect))
|
||||
{
|
||||
delete texture;
|
||||
texture = NULL;
|
||||
@@ -131,7 +131,7 @@ sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTexture* sfTexture_Copy(sfTexture* texture)
|
||||
sfTexture* sfTexture_copy(sfTexture* texture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(texture, NULL);
|
||||
|
||||
@@ -140,116 +140,116 @@ sfTexture* sfTexture_Copy(sfTexture* texture)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_Destroy(sfTexture* texture)
|
||||
void sfTexture_destroy(sfTexture* texture)
|
||||
{
|
||||
delete texture;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfTexture_GetWidth(const sfTexture* texture)
|
||||
unsigned int sfTexture_getWidth(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL_PTR_RETURN(texture, GetWidth(), 0);
|
||||
CSFML_CALL_PTR_RETURN(texture, getWidth(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfTexture_GetHeight(const sfTexture* texture)
|
||||
unsigned int sfTexture_getHeight(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL_PTR_RETURN(texture, GetHeight(), 0);
|
||||
CSFML_CALL_PTR_RETURN(texture, getHeight(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfImage* sfTexture_CopyToImage(const sfTexture* texture)
|
||||
sfImage* sfTexture_copyToImage(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(texture, NULL);
|
||||
CSFML_CHECK_RETURN(texture->This, NULL);
|
||||
|
||||
sfImage* image = new sfImage;
|
||||
image->This = texture->This->CopyToImage();
|
||||
image->This = texture->This->copyToImage();
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_UpdateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)
|
||||
void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)
|
||||
{
|
||||
CSFML_CALL_PTR(texture, Update(pixels, width, height, x, y));
|
||||
CSFML_CALL_PTR(texture, update(pixels, width, height, x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_UpdateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y)
|
||||
void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y)
|
||||
{
|
||||
CSFML_CHECK(image);
|
||||
|
||||
CSFML_CALL_PTR(texture, Update(image->This, x, y));
|
||||
CSFML_CALL_PTR(texture, update(image->This, x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_UpdateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y)
|
||||
void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y)
|
||||
{
|
||||
CSFML_CHECK(window);
|
||||
|
||||
CSFML_CALL_PTR(texture, Update(window->This, x, y));
|
||||
CSFML_CALL_PTR(texture, update(window->This, x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_UpdateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y)
|
||||
void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y)
|
||||
{
|
||||
CSFML_CHECK(renderWindow);
|
||||
|
||||
CSFML_CALL_PTR(texture, Update(renderWindow->This, x, y));
|
||||
CSFML_CALL_PTR(texture, update(renderWindow->This, x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_Bind(const sfTexture* texture)
|
||||
void sfTexture_bind(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL_PTR(texture, Bind());
|
||||
CSFML_CALL_PTR(texture, bind());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_SetSmooth(sfTexture* texture, sfBool smooth)
|
||||
void sfTexture_setSmooth(sfTexture* texture, sfBool smooth)
|
||||
{
|
||||
CSFML_CALL_PTR(texture, SetSmooth(smooth == sfTrue));
|
||||
CSFML_CALL_PTR(texture, setSmooth(smooth == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfTexture_IsSmooth(const sfTexture* texture)
|
||||
sfBool sfTexture_isSmooth(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(texture, sfFalse);
|
||||
CSFML_CHECK_RETURN(texture->This, sfFalse);
|
||||
|
||||
return texture->This->IsSmooth();
|
||||
return texture->This->isSmooth();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_SetRepeated(sfTexture* texture, sfBool repeated)
|
||||
void sfTexture_setRepeated(sfTexture* texture, sfBool repeated)
|
||||
{
|
||||
CSFML_CALL_PTR(texture, SetRepeated(repeated == sfTrue));
|
||||
CSFML_CALL_PTR(texture, setRepeated(repeated == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfTexture_IsRepeated(const sfTexture* texture)
|
||||
sfBool sfTexture_isRepeated(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CHECK_RETURN(texture, sfFalse);
|
||||
CSFML_CHECK_RETURN(texture->This, sfFalse);
|
||||
|
||||
return texture->This->IsRepeated();
|
||||
return texture->This->isRepeated();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfTexture_GetMaximumSize()
|
||||
unsigned int sfTexture_getMaximumSize()
|
||||
{
|
||||
return sf::Texture::GetMaximumSize();
|
||||
return sf::Texture::getMaximumSize();
|
||||
}
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTransform* sfTransform_Create(void)
|
||||
sfTransform* sfTransform_create(void)
|
||||
{
|
||||
return new sfTransform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTransform* sfTransform_CreateFromMatrix(float a00, float a01, float a02,
|
||||
sfTransform* sfTransform_createFromMatrix(float a00, float a01, float a02,
|
||||
float a10, float a11, float a12,
|
||||
float a20, float a21, float a22)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ sfTransform* sfTransform_CreateFromMatrix(float a00, float a01, float a02,
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTransform* sfTransform_Copy(sfTransform* transform)
|
||||
sfTransform* sfTransform_copy(sfTransform* transform)
|
||||
{
|
||||
CSFML_CHECK_RETURN(transform, NULL);
|
||||
|
||||
@@ -58,99 +58,100 @@ sfTransform* sfTransform_Copy(sfTransform* transform)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_Destroy(sfTransform* transform)
|
||||
void sfTransform_destroy(sfTransform* transform)
|
||||
{
|
||||
delete transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const float* sfTransform_GetMatrix(const sfTransform* transform)
|
||||
const float* sfTransform_getMatrix(const sfTransform* transform)
|
||||
{
|
||||
CSFML_CALL_RETURN(transform, GetMatrix(), NULL);
|
||||
CSFML_CALL_RETURN(transform, getMatrix(), NULL);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_GetInverse(const sfTransform* transform, sfTransform* result)
|
||||
void sfTransform_getInverse(const sfTransform* transform, sfTransform* result)
|
||||
{
|
||||
CSFML_CHECK(transform);
|
||||
|
||||
if (result)
|
||||
result->This = transform->This.GetInverse();
|
||||
result->This = transform->This.getInverse();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_TransformPoint(const sfTransform* transform, float x, float y, float* transformedX, float* transformedY)
|
||||
sfVector2f sfTransform_transformPoint(const sfTransform* transform, sfVector2f point)
|
||||
{
|
||||
CSFML_CHECK(transform);
|
||||
sfVector2f p = {0, 0};
|
||||
CSFML_CHECK_RETURN(transform, p);
|
||||
|
||||
sf::Vector2f point = transform->This.TransformPoint(x, y);
|
||||
sf::Vector2f sfmlPoint = transform->This.transformPoint(point.x, point.y);
|
||||
|
||||
if (transformedX)
|
||||
*transformedX = point.x;
|
||||
if (transformedY)
|
||||
*transformedY = point.y;
|
||||
p.x = sfmlPoint.x;
|
||||
p.y = sfmlPoint.y;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_TransformRect(const sfTransform* transform, sfFloatRect rectangle, sfFloatRect* transformedRectangle)
|
||||
sfFloatRect sfTransform_transformRect(const sfTransform* transform, sfFloatRect rectangle)
|
||||
{
|
||||
CSFML_CHECK(transform);
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(transform, rect);
|
||||
|
||||
sf::FloatRect rect = transform->This.TransformRect(sf::FloatRect(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height));
|
||||
sf::FloatRect sfmlRect = transform->This.transformRect(sf::FloatRect(rectangle.left, rectangle.top, rectangle.width, rectangle.height));
|
||||
|
||||
if (transformedRectangle)
|
||||
{
|
||||
transformedRectangle->Left = rect.Left;
|
||||
transformedRectangle->Top = rect.Top;
|
||||
transformedRectangle->Width = rect.Width;
|
||||
transformedRectangle->Height = rect.Height;
|
||||
}
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_Combine(sfTransform* transform, const sfTransform* other)
|
||||
void sfTransform_combine(sfTransform* transform, const sfTransform* other)
|
||||
{
|
||||
CSFML_CHECK(other);
|
||||
|
||||
CSFML_CALL(transform, Combine(other->This));
|
||||
CSFML_CALL(transform, combine(other->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_Translate(sfTransform* transform, float x, float y)
|
||||
void sfTransform_translate(sfTransform* transform, float x, float y)
|
||||
{
|
||||
CSFML_CALL(transform, Translate(x, y));
|
||||
CSFML_CALL(transform, translate(x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_Rotate(sfTransform* transform, float angle)
|
||||
void sfTransform_rotate(sfTransform* transform, float angle)
|
||||
{
|
||||
CSFML_CALL(transform, Rotate(angle));
|
||||
CSFML_CALL(transform, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_RotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY)
|
||||
void sfTransform_rotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY)
|
||||
{
|
||||
CSFML_CALL(transform, Rotate(angle, centerX, centerY));
|
||||
CSFML_CALL(transform, rotate(angle, centerX, centerY));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_Scale(sfTransform* transform, float scaleX, float scaleY)
|
||||
void sfTransform_scale(sfTransform* transform, float scaleX, float scaleY)
|
||||
{
|
||||
CSFML_CALL(transform, Scale(scaleX, scaleY));
|
||||
CSFML_CALL(transform, scale(scaleX, scaleY));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransform_ScaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY)
|
||||
void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY)
|
||||
{
|
||||
CSFML_CALL(transform, Scale(scaleX, scaleY, centerX, centerY));
|
||||
CSFML_CALL(transform, scale(scaleX, scaleY, centerX, centerY));
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTransformable* sfTransformable_Create(void)
|
||||
sfTransformable* sfTransformable_create(void)
|
||||
{
|
||||
sfTransformable* transformable = new sfTransformable;
|
||||
|
||||
@@ -40,7 +40,7 @@ sfTransformable* sfTransformable_Create(void)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTransformable* sfTransformable_Copy(sfTransformable* transformable)
|
||||
sfTransformable* sfTransformable_copy(sfTransformable* transformable)
|
||||
{
|
||||
CSFML_CHECK_RETURN(transformable, NULL);
|
||||
|
||||
@@ -49,47 +49,47 @@ sfTransformable* sfTransformable_Copy(sfTransformable* transformable)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_Destroy(sfTransformable* transformable)
|
||||
void sfTransformable_destroy(sfTransformable* transformable)
|
||||
{
|
||||
delete transformable;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_SetPosition(sfTransformable* transformable, sfVector2f position)
|
||||
void sfTransformable_setPosition(sfTransformable* transformable, sfVector2f position)
|
||||
{
|
||||
CSFML_CALL(transformable, SetPosition(position.x, position.y));
|
||||
CSFML_CALL(transformable, setPosition(position.x, position.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_SetRotation(sfTransformable* transformable, float angle)
|
||||
void sfTransformable_setRotation(sfTransformable* transformable, float angle)
|
||||
{
|
||||
CSFML_CALL(transformable, SetRotation(angle));
|
||||
CSFML_CALL(transformable, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_SetScale(sfTransformable* transformable, sfVector2f scale)
|
||||
void sfTransformable_setScale(sfTransformable* transformable, sfVector2f scale)
|
||||
{
|
||||
CSFML_CALL(transformable, SetScale(scale.x, scale.y));
|
||||
CSFML_CALL(transformable, setScale(scale.x, scale.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_SetOrigin(sfTransformable* transformable, sfVector2f origin)
|
||||
void sfTransformable_setOrigin(sfTransformable* transformable, sfVector2f origin)
|
||||
{
|
||||
CSFML_CALL(transformable, SetOrigin(origin.x, origin.y));
|
||||
CSFML_CALL(transformable, setOrigin(origin.x, origin.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfTransformable_GetPosition(const sfTransformable* transformable)
|
||||
sfVector2f sfTransformable_getPosition(const sfTransformable* transformable)
|
||||
{
|
||||
sfVector2f position = {0, 0};
|
||||
CSFML_CHECK_RETURN(transformable, position);
|
||||
|
||||
sf::Vector2f sfmlPos = transformable->This.GetPosition();
|
||||
sf::Vector2f sfmlPos = transformable->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -98,19 +98,19 @@ sfVector2f sfTransformable_GetPosition(const sfTransformable* transformable)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfTransformable_GetRotation(const sfTransformable* transformable)
|
||||
float sfTransformable_getRotation(const sfTransformable* transformable)
|
||||
{
|
||||
CSFML_CALL_RETURN(transformable, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(transformable, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfTransformable_GetScale(const sfTransformable* transformable)
|
||||
sfVector2f sfTransformable_getScale(const sfTransformable* transformable)
|
||||
{
|
||||
sfVector2f scale = {0, 0};
|
||||
CSFML_CHECK_RETURN(transformable, scale);
|
||||
|
||||
sf::Vector2f sfmlScale = transformable->This.GetScale();
|
||||
sf::Vector2f sfmlScale = transformable->This.getScale();
|
||||
scale.x = sfmlScale.x;
|
||||
scale.y = sfmlScale.y;
|
||||
|
||||
@@ -119,12 +119,12 @@ sfVector2f sfTransformable_GetScale(const sfTransformable* transformable)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfTransformable_GetOrigin(const sfTransformable* transformable)
|
||||
sfVector2f sfTransformable_getOrigin(const sfTransformable* transformable)
|
||||
{
|
||||
sfVector2f origin = {0, 0};
|
||||
CSFML_CHECK_RETURN(transformable, origin);
|
||||
|
||||
sf::Vector2f sfmlOrigin = transformable->This.GetOrigin();
|
||||
sf::Vector2f sfmlOrigin = transformable->This.getOrigin();
|
||||
origin.x = sfmlOrigin.x;
|
||||
origin.y = sfmlOrigin.y;
|
||||
|
||||
@@ -133,41 +133,41 @@ sfVector2f sfTransformable_GetOrigin(const sfTransformable* transformable)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_Move(sfTransformable* transformable, sfVector2f offset)
|
||||
void sfTransformable_move(sfTransformable* transformable, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(transformable, Move(offset.x, offset.y));
|
||||
CSFML_CALL(transformable, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_Rotate(sfTransformable* transformable, float angle)
|
||||
void sfTransformable_rotate(sfTransformable* transformable, float angle)
|
||||
{
|
||||
CSFML_CALL(transformable, Rotate(angle));
|
||||
CSFML_CALL(transformable, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTransformable_Scale(sfTransformable* transformable, sfVector2f factors)
|
||||
void sfTransformable_scale(sfTransformable* transformable, sfVector2f factors)
|
||||
{
|
||||
CSFML_CALL(transformable, Scale(factors.x, factors.y));
|
||||
CSFML_CALL(transformable, scale(factors.x, factors.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfTransformable_GetTransform(const sfTransformable* transformable)
|
||||
const sfTransform* sfTransformable_getTransform(const sfTransformable* transformable)
|
||||
{
|
||||
CSFML_CHECK_RETURN(transformable, NULL);
|
||||
|
||||
transformable->Transform.This = transformable->This.GetTransform();
|
||||
transformable->Transform.This = transformable->This.getTransform();
|
||||
return &transformable->Transform;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfTransform* sfTransformable_GetInverseTransform(const sfTransformable* transformable)
|
||||
const sfTransform* sfTransformable_getInverseTransform(const sfTransformable* transformable)
|
||||
{
|
||||
CSFML_CHECK_RETURN(transformable, NULL);
|
||||
|
||||
transformable->InverseTransform.This = transformable->This.GetInverseTransform();
|
||||
transformable->InverseTransform.This = transformable->This.getInverseTransform();
|
||||
return &transformable->InverseTransform;
|
||||
}
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVertexArray* sfVertexArray_Create(void)
|
||||
sfVertexArray* sfVertexArray_create(void)
|
||||
{
|
||||
return new sfVertexArray;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVertexArray* sfVertexArray_Copy(sfVertexArray* vertexArray)
|
||||
sfVertexArray* sfVertexArray_copy(sfVertexArray* vertexArray)
|
||||
{
|
||||
CSFML_CHECK_RETURN(vertexArray, NULL);
|
||||
|
||||
@@ -47,21 +47,21 @@ sfVertexArray* sfVertexArray_Copy(sfVertexArray* vertexArray)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfVertexArray_Destroy(sfVertexArray* vertexArray)
|
||||
void sfVertexArray_destroy(sfVertexArray* vertexArray)
|
||||
{
|
||||
delete vertexArray;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfVertexArray_GetVertexCount(const sfVertexArray* vertexArray)
|
||||
unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray)
|
||||
{
|
||||
CSFML_CALL_RETURN(vertexArray, GetVertexCount(), 0);
|
||||
CSFML_CALL_RETURN(vertexArray, getVertexCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVertex* sfVertexArray_GetVertex(sfVertexArray* vertexArray, unsigned int index)
|
||||
sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index)
|
||||
{
|
||||
CSFML_CHECK_RETURN(vertexArray, NULL);
|
||||
|
||||
@@ -71,53 +71,53 @@ sfVertex* sfVertexArray_GetVertex(sfVertexArray* vertexArray, unsigned int index
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfVertexArray_Clear(sfVertexArray* vertexArray)
|
||||
void sfVertexArray_clear(sfVertexArray* vertexArray)
|
||||
{
|
||||
CSFML_CALL(vertexArray, Clear());
|
||||
CSFML_CALL(vertexArray, clear());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfVertexArray_Resize(sfVertexArray* vertexArray, unsigned int vertexCount)
|
||||
void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount)
|
||||
{
|
||||
CSFML_CALL(vertexArray, Resize(vertexCount));
|
||||
CSFML_CALL(vertexArray, resize(vertexCount));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfVertexArray_Append(sfVertexArray* vertexArray, sfVertex vertex)
|
||||
void sfVertexArray_append(sfVertexArray* vertexArray, sfVertex vertex)
|
||||
{
|
||||
// the cast is safe, sfVertex has to be binary compatible with sf::Vertex
|
||||
CSFML_CALL(vertexArray, Append(reinterpret_cast<sf::Vertex&>(vertex)));
|
||||
CSFML_CALL(vertexArray, append(reinterpret_cast<sf::Vertex&>(vertex)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfVertexArray_SetPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type)
|
||||
void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type)
|
||||
{
|
||||
CSFML_CALL(vertexArray, SetPrimitiveType(static_cast<sf::PrimitiveType>(type)));
|
||||
CSFML_CALL(vertexArray, setPrimitiveType(static_cast<sf::PrimitiveType>(type)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfPrimitiveType sfVertexArray_GetPrimitiveType(sfVertexArray* vertexArray)
|
||||
sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray)
|
||||
{
|
||||
CSFML_CHECK_RETURN(vertexArray, sfPoints);
|
||||
return static_cast<sfPrimitiveType>(vertexArray->This.GetPrimitiveType());
|
||||
return static_cast<sfPrimitiveType>(vertexArray->This.getPrimitiveType());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfVertexArray_GetBounds(sfVertexArray* vertexArray)
|
||||
sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(vertexArray, rect);
|
||||
|
||||
sf::FloatRect sfmlRect = vertexArray->This.GetBounds();
|
||||
rect.Left = sfmlRect.Left;
|
||||
rect.Top = sfmlRect.Top;
|
||||
rect.Width = sfmlRect.Width;
|
||||
rect.Height = sfmlRect.Height;
|
||||
sf::FloatRect sfmlRect = vertexArray->This.getBounds();
|
||||
rect.left = sfmlRect.left;
|
||||
rect.top = sfmlRect.top;
|
||||
rect.width = sfmlRect.width;
|
||||
rect.height = sfmlRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
+33
-33
@@ -31,24 +31,24 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfView* sfView_Create(void)
|
||||
sfView* sfView_create(void)
|
||||
{
|
||||
return new sfView;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfView* sfView_CreateFromRect(sfFloatRect rectangle)
|
||||
sfView* sfView_createFromRect(sfFloatRect rectangle)
|
||||
{
|
||||
sfView* view = new sfView;
|
||||
sfView_Reset(view, rectangle);
|
||||
sfView_reset(view, rectangle);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfView* sfView_Copy(sfView* view)
|
||||
sfView* sfView_copy(sfView* view)
|
||||
{
|
||||
CSFML_CHECK_RETURN(view, NULL);
|
||||
|
||||
@@ -57,54 +57,54 @@ sfView* sfView_Copy(sfView* view)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_Destroy(sfView* view)
|
||||
void sfView_destroy(sfView* view)
|
||||
{
|
||||
delete view;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_SetCenter(sfView* view, sfVector2f center)
|
||||
void sfView_setCenter(sfView* view, sfVector2f center)
|
||||
{
|
||||
CSFML_CALL(view, SetCenter(center.x, center.y));
|
||||
CSFML_CALL(view, setCenter(center.x, center.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_SetSize(sfView* view, sfVector2f size)
|
||||
void sfView_setSize(sfView* view, sfVector2f size)
|
||||
{
|
||||
CSFML_CALL(view, SetSize(size.x, size.y));
|
||||
CSFML_CALL(view, setSize(size.x, size.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_SetRotation(sfView* view, float angle)
|
||||
void sfView_setRotation(sfView* view, float angle)
|
||||
{
|
||||
CSFML_CALL(view, SetRotation(angle));
|
||||
CSFML_CALL(view, setRotation(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_SetViewport(sfView* view, sfFloatRect viewport)
|
||||
void sfView_setViewport(sfView* view, sfFloatRect viewport)
|
||||
{
|
||||
CSFML_CALL(view, SetViewport(sf::FloatRect(viewport.Left, viewport.Top, viewport.Width, viewport.Height)));
|
||||
CSFML_CALL(view, setViewport(sf::FloatRect(viewport.left, viewport.top, viewport.width, viewport.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_Reset(sfView* view, sfFloatRect rectangle)
|
||||
void sfView_reset(sfView* view, sfFloatRect rectangle)
|
||||
{
|
||||
CSFML_CALL(view, Reset(sf::FloatRect(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height)));
|
||||
CSFML_CALL(view, reset(sf::FloatRect(rectangle.left, rectangle.top, rectangle.width, rectangle.height)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfView_GetCenter(const sfView* view)
|
||||
sfVector2f sfView_getCenter(const sfView* view)
|
||||
{
|
||||
sfVector2f center = {0, 0};
|
||||
CSFML_CHECK_RETURN(view, center);
|
||||
|
||||
sf::Vector2f sfmlCenter = view->This.GetCenter();
|
||||
sf::Vector2f sfmlCenter = view->This.getCenter();
|
||||
center.x = sfmlCenter.x;
|
||||
center.y = sfmlCenter.y;
|
||||
|
||||
@@ -113,12 +113,12 @@ sfVector2f sfView_GetCenter(const sfView* view)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfView_GetSize(const sfView* view)
|
||||
sfVector2f sfView_getSize(const sfView* view)
|
||||
{
|
||||
sfVector2f size = {0, 0};
|
||||
CSFML_CHECK_RETURN(view, size);
|
||||
|
||||
sf::Vector2f sfmlSize = view->This.GetSize();
|
||||
sf::Vector2f sfmlSize = view->This.getSize();
|
||||
size.x = sfmlSize.x;
|
||||
size.y = sfmlSize.y;
|
||||
|
||||
@@ -127,44 +127,44 @@ sfVector2f sfView_GetSize(const sfView* view)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfView_GetRotation(const sfView* view)
|
||||
float sfView_getRotation(const sfView* view)
|
||||
{
|
||||
CSFML_CALL_RETURN(view, GetRotation(), 0.f);
|
||||
CSFML_CALL_RETURN(view, getRotation(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFloatRect sfView_GetViewport(const sfView* view)
|
||||
sfFloatRect sfView_getViewport(const sfView* view)
|
||||
{
|
||||
sfFloatRect rect = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(view, rect);
|
||||
|
||||
sf::FloatRect SFMLRect = view->This.GetViewport();
|
||||
rect.Left = SFMLRect.Left;
|
||||
rect.Top = SFMLRect.Top;
|
||||
rect.Width = SFMLRect.Width;
|
||||
rect.Height = SFMLRect.Height;
|
||||
sf::FloatRect SFMLRect = view->This.getViewport();
|
||||
rect.left = SFMLRect.left;
|
||||
rect.top = SFMLRect.top;
|
||||
rect.width = SFMLRect.width;
|
||||
rect.height = SFMLRect.height;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_Move(sfView* view, sfVector2f offset)
|
||||
void sfView_move(sfView* view, sfVector2f offset)
|
||||
{
|
||||
CSFML_CALL(view, Move(offset.x, offset.y));
|
||||
CSFML_CALL(view, move(offset.x, offset.y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_Rotate(sfView* view, float angle)
|
||||
void sfView_rotate(sfView* view, float angle)
|
||||
{
|
||||
CSFML_CALL(view, Rotate(angle));
|
||||
CSFML_CALL(view, rotate(angle));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfView_Zoom(sfView* view, float factor)
|
||||
void sfView_zoom(sfView* view, float factor)
|
||||
{
|
||||
CSFML_CALL(view, Zoom(factor));
|
||||
CSFML_CALL(view, zoom(factor));
|
||||
}
|
||||
+60
-60
@@ -32,278 +32,278 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResponse)
|
||||
void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse)
|
||||
{
|
||||
delete ftpListingResponse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfFtpListingResponse_IsOk(const sfFtpListingResponse* ftpListingResponse)
|
||||
sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse)
|
||||
{
|
||||
CSFML_CALL_RETURN(ftpListingResponse, IsOk(), sfFalse);
|
||||
CSFML_CALL_RETURN(ftpListingResponse, isOk(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpStatus sfFtpListingResponse_GetStatus(const sfFtpListingResponse* ftpListingResponse)
|
||||
sfFtpStatus sfFtpListingResponse_getStatus(const sfFtpListingResponse* ftpListingResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpListingResponse, sfFtpInvalidResponse);
|
||||
|
||||
return static_cast<sfFtpStatus>(ftpListingResponse->This.GetStatus());
|
||||
return static_cast<sfFtpStatus>(ftpListingResponse->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfFtpListingResponse_GetMessage(const sfFtpListingResponse* ftpListingResponse)
|
||||
const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpListingResponse, NULL);
|
||||
|
||||
return ftpListingResponse->This.GetMessage().c_str();
|
||||
return ftpListingResponse->This.getMessage().c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
size_t sfFtpListingResponse_GetCount(const sfFtpListingResponse* ftpListingResponse)
|
||||
size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpListingResponse, 0);
|
||||
|
||||
return ftpListingResponse->This.GetFilenames().size();
|
||||
return ftpListingResponse->This.getFilenames().size();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfFtpListingResponse_GetFilename(const sfFtpListingResponse* ftpListingResponse, size_t index)
|
||||
const char* sfFtpListingResponse_getFilename(const sfFtpListingResponse* ftpListingResponse, size_t index)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpListingResponse, NULL);
|
||||
|
||||
return ftpListingResponse->This.GetFilenames()[index].c_str();
|
||||
return ftpListingResponse->This.getFilenames()[index].c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
{
|
||||
delete ftpDirectoryResponse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfFtpDirectoryResponse_IsOk(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
{
|
||||
CSFML_CALL_RETURN(ftpDirectoryResponse, IsOk(), sfFalse);
|
||||
CSFML_CALL_RETURN(ftpDirectoryResponse, isOk(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpStatus sfFtpDirectoryResponse_GetStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
sfFtpStatus sfFtpDirectoryResponse_getStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpDirectoryResponse, sfFtpInvalidResponse);
|
||||
|
||||
return static_cast<sfFtpStatus>(ftpDirectoryResponse->This.GetStatus());
|
||||
return static_cast<sfFtpStatus>(ftpDirectoryResponse->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfFtpDirectoryResponse_GetMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL);
|
||||
|
||||
return ftpDirectoryResponse->This.GetMessage().c_str();
|
||||
return ftpDirectoryResponse->This.getMessage().c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfFtpDirectoryResponse_GetDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL);
|
||||
|
||||
return ftpDirectoryResponse->This.GetDirectory().c_str();
|
||||
return ftpDirectoryResponse->This.getDirectory().c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse)
|
||||
void sfFtpResponse_destroy(sfFtpResponse* ftpResponse)
|
||||
{
|
||||
delete ftpResponse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfFtpResponse_IsOk(const sfFtpResponse* ftpResponse)
|
||||
sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse)
|
||||
{
|
||||
CSFML_CALL_RETURN(ftpResponse, IsOk(), sfFalse);
|
||||
CSFML_CALL_RETURN(ftpResponse, isOk(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpStatus sfFtpResponse_GetStatus(const sfFtpResponse* ftpResponse)
|
||||
sfFtpStatus sfFtpResponse_getStatus(const sfFtpResponse* ftpResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpResponse, sfFtpInvalidResponse);
|
||||
|
||||
return static_cast<sfFtpStatus>(ftpResponse->This.GetStatus());
|
||||
return static_cast<sfFtpStatus>(ftpResponse->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfFtpResponse_GetMessage(const sfFtpResponse* ftpResponse)
|
||||
const char* sfFtpResponse_getMessage(const sfFtpResponse* ftpResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftpResponse, NULL);
|
||||
|
||||
return ftpResponse->This.GetMessage().c_str();
|
||||
return ftpResponse->This.getMessage().c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtp* sfFtp_Create(void)
|
||||
sfFtp* sfFtp_create(void)
|
||||
{
|
||||
return new sfFtp;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfFtp_Destroy(sfFtp* ftp)
|
||||
void sfFtp_destroy(sfFtp* ftp)
|
||||
{
|
||||
delete ftp;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout)
|
||||
sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
sf::IpAddress SFMLServer(server.Address);
|
||||
sf::IpAddress SFMLServer(server.address);
|
||||
|
||||
return new sfFtpResponse(ftp->This.Connect(SFMLServer, port, sf::Microseconds(timeout.Microseconds)));
|
||||
return new sfFtpResponse(ftp->This.connect(SFMLServer, port, sf::microseconds(timeout.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp)
|
||||
sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.Login());
|
||||
return new sfFtpResponse(ftp->This.login());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, const char* password)
|
||||
sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.Login(userName ? userName : "", password ? password : ""));
|
||||
return new sfFtpResponse(ftp->This.login(userName ? userName : "", password ? password : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp)
|
||||
sfFtpResponse* sfFtp_disconnect(sfFtp* ftp)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.Disconnect());
|
||||
return new sfFtpResponse(ftp->This.disconnect());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp)
|
||||
sfFtpResponse* sfFtp_keepAlive(sfFtp* ftp)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.KeepAlive());
|
||||
return new sfFtpResponse(ftp->This.keepAlive());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp)
|
||||
sfFtpDirectoryResponse* sfFtp_getWorkingDirectory(sfFtp* ftp)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpDirectoryResponse(ftp->This.GetWorkingDirectory());
|
||||
return new sfFtpDirectoryResponse(ftp->This.getWorkingDirectory());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, const char* directory)
|
||||
sfFtpListingResponse* sfFtp_getDirectoryListing(sfFtp* ftp, const char* directory)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpListingResponse(ftp->This.GetDirectoryListing(directory ? directory : ""));
|
||||
return new sfFtpListingResponse(ftp->This.getDirectoryListing(directory ? directory : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* directory)
|
||||
sfFtpResponse* sfFtp_changeDirectory(sfFtp* ftp, const char* directory)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.ChangeDirectory(directory ? directory : ""));
|
||||
return new sfFtpResponse(ftp->This.changeDirectory(directory ? directory : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp)
|
||||
sfFtpResponse* sfFtp_parentDirectory(sfFtp* ftp)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.ParentDirectory());
|
||||
return new sfFtpResponse(ftp->This.parentDirectory());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_CreateDirectory(sfFtp* ftp, const char* name)
|
||||
sfFtpResponse* sfFtp_createDirectory(sfFtp* ftp, const char* name)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.CreateDirectory(name ? name : ""));
|
||||
return new sfFtpResponse(ftp->This.createDirectory(name ? name : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* name)
|
||||
sfFtpResponse* sfFtp_deleteDirectory(sfFtp* ftp, const char* name)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.DeleteDirectory(name ? name : ""));
|
||||
return new sfFtpResponse(ftp->This.deleteDirectory(name ? name : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file, const char* newName)
|
||||
sfFtpResponse* sfFtp_renameFile(sfFtp* ftp, const char* file, const char* newName)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.RenameFile(file ? file : "", newName ? newName : ""));
|
||||
return new sfFtpResponse(ftp->This.renameFile(file ? file : "", newName ? newName : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name)
|
||||
sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.DeleteFile(name ? name : ""));
|
||||
return new sfFtpResponse(ftp->This.deleteFile(name ? name : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode)
|
||||
sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.Download(distantFile ? distantFile : "",
|
||||
return new sfFtpResponse(ftp->This.download(distantFile ? distantFile : "",
|
||||
destPath ? destPath : "",
|
||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_Upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode)
|
||||
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.Upload(localFile ? localFile : "",
|
||||
return new sfFtpResponse(ftp->This.upload(localFile ? localFile : "",
|
||||
destPath ? destPath : "",
|
||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||
}
|
||||
+29
-29
@@ -31,135 +31,135 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfHttpRequest* sfHttpRequest_Create(void)
|
||||
sfHttpRequest* sfHttpRequest_create(void)
|
||||
{
|
||||
return new sfHttpRequest;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpRequest_Destroy(sfHttpRequest* httpRequest)
|
||||
void sfHttpRequest_destroy(sfHttpRequest* httpRequest)
|
||||
{
|
||||
delete httpRequest;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const char* field, const char* value)
|
||||
void sfHttpRequest_setField(sfHttpRequest* httpRequest, const char* field, const char* value)
|
||||
{
|
||||
CSFML_CHECK(httpRequest);
|
||||
if (field)
|
||||
httpRequest->This.SetField(field, value);
|
||||
httpRequest->This.setField(field, value);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHttpMethod method)
|
||||
void sfHttpRequest_setMethod(sfHttpRequest* httpRequest, sfHttpMethod method)
|
||||
{
|
||||
CSFML_CALL(httpRequest, SetMethod(static_cast<sf::Http::Request::Method>(method)));
|
||||
CSFML_CALL(httpRequest, setMethod(static_cast<sf::Http::Request::Method>(method)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpRequest_SetUri(sfHttpRequest* httpRequest, const char* uri)
|
||||
void sfHttpRequest_setUri(sfHttpRequest* httpRequest, const char* uri)
|
||||
{
|
||||
CSFML_CALL(httpRequest, SetUri(uri ? uri : ""));
|
||||
CSFML_CALL(httpRequest, setUri(uri ? uri : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor)
|
||||
void sfHttpRequest_setHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor)
|
||||
{
|
||||
CSFML_CALL(httpRequest, SetHttpVersion(major, minor));
|
||||
CSFML_CALL(httpRequest, setHttpVersion(major, minor));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const char* body)
|
||||
void sfHttpRequest_setBody(sfHttpRequest* httpRequest, const char* body)
|
||||
{
|
||||
CSFML_CALL(httpRequest, SetBody(body ? body : ""));
|
||||
CSFML_CALL(httpRequest, setBody(body ? body : ""));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttpResponse_Destroy(sfHttpResponse* httpResponse)
|
||||
void sfHttpResponse_destroy(sfHttpResponse* httpResponse)
|
||||
{
|
||||
delete httpResponse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfHttpResponse_GetField(const sfHttpResponse* httpResponse, const char* field)
|
||||
const char* sfHttpResponse_getField(const sfHttpResponse* httpResponse, const char* field)
|
||||
{
|
||||
CSFML_CHECK_RETURN(httpResponse, NULL);
|
||||
if (!field)
|
||||
return NULL;
|
||||
|
||||
return httpResponse->This.GetField(field).c_str();
|
||||
return httpResponse->This.getField(field).c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfHttpStatus sfHttpResponse_GetStatus(const sfHttpResponse* httpResponse)
|
||||
sfHttpStatus sfHttpResponse_getStatus(const sfHttpResponse* httpResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(httpResponse, sfHttpInvalidResponse);
|
||||
|
||||
return static_cast<sfHttpStatus>(httpResponse->This.GetStatus());
|
||||
return static_cast<sfHttpStatus>(httpResponse->This.getStatus());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfHttpResponse_GetMajorVersion(const sfHttpResponse* httpResponse)
|
||||
unsigned int sfHttpResponse_getMajorVersion(const sfHttpResponse* httpResponse)
|
||||
{
|
||||
CSFML_CALL_RETURN(httpResponse, GetMajorHttpVersion(), 0);
|
||||
CSFML_CALL_RETURN(httpResponse, getMajorHttpVersion(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfHttpResponse_GetMinorVersion(const sfHttpResponse* httpResponse)
|
||||
unsigned int sfHttpResponse_getMinorVersion(const sfHttpResponse* httpResponse)
|
||||
{
|
||||
CSFML_CALL_RETURN(httpResponse, GetMinorHttpVersion(), 0);
|
||||
CSFML_CALL_RETURN(httpResponse, getMinorHttpVersion(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfHttpResponse_GetBody(const sfHttpResponse* httpResponse)
|
||||
const char* sfHttpResponse_getBody(const sfHttpResponse* httpResponse)
|
||||
{
|
||||
CSFML_CHECK_RETURN(httpResponse, NULL);
|
||||
|
||||
return httpResponse->This.GetBody().c_str();
|
||||
return httpResponse->This.getBody().c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfHttp* sfHttp_Create(void)
|
||||
sfHttp* sfHttp_create(void)
|
||||
{
|
||||
return new sfHttp;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttp_Destroy(sfHttp* http)
|
||||
void sfHttp_destroy(sfHttp* http)
|
||||
{
|
||||
delete http;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port)
|
||||
void sfHttp_setHost(sfHttp* http, const char* host, unsigned short port)
|
||||
{
|
||||
CSFML_CALL(http, SetHost(host ? host : "", port));
|
||||
CSFML_CALL(http, setHost(host ? host : "", port));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout)
|
||||
sfHttpResponse* sfHttp_sendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout)
|
||||
{
|
||||
CSFML_CHECK_RETURN(http, NULL);
|
||||
CSFML_CHECK_RETURN(request, NULL);
|
||||
|
||||
sfHttpResponse* response = new sfHttpResponse;
|
||||
response->This = http->This.SendRequest(request->This, sf::Microseconds(timeout.Microseconds));
|
||||
response->This = http->This.sendRequest(request->This, sf::microseconds(timeout.microseconds));
|
||||
|
||||
return response;
|
||||
}
|
||||
@@ -33,88 +33,79 @@
|
||||
namespace
|
||||
{
|
||||
// Helper function for converting a SFML address to a CSFML one
|
||||
sfIpAddress FromSFMLAddress(sf::IpAddress address)
|
||||
sfIpAddress fromSFMLAddress(sf::IpAddress address)
|
||||
{
|
||||
sfIpAddress result;
|
||||
strncpy(result.Address, address.ToString().c_str(), 16);
|
||||
strncpy(result.address, address.toString().c_str(), 16);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Helper function for converting a CSFML address to a SFML one
|
||||
sf::IpAddress ToSFMLAddress(sfIpAddress address)
|
||||
sf::IpAddress toSFMLAddress(sfIpAddress address)
|
||||
{
|
||||
return sf::IpAddress(address.Address);
|
||||
return sf::IpAddress(address.address);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_FromString(const char* address)
|
||||
sfIpAddress sfIpAddress_None = sfIpAddress_fromBytes(0, 0, 0, 0);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_LocalHost = sfIpAddress_fromBytes(127, 0, 0, 1);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_Broadcast = sfIpAddress_fromBytes(255, 255, 255, 255);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_fromString(const char* address)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress(address));
|
||||
return fromSFMLAddress(sf::IpAddress(address));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3)
|
||||
sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress(byte0, byte1, byte2, byte3));
|
||||
return fromSFMLAddress(sf::IpAddress(byte0, byte1, byte2, byte3));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_FromInteger(sfUint32 address)
|
||||
sfIpAddress sfIpAddress_fromInteger(sfUint32 address)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress(address));
|
||||
return fromSFMLAddress(sf::IpAddress(address));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfIpAddress_ToString(sfIpAddress address, char* string)
|
||||
void sfIpAddress_toString(sfIpAddress address, char* string)
|
||||
{
|
||||
if (string)
|
||||
strcpy(string, address.Address);
|
||||
strcpy(string, address.address);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfUint32 sfIpAddress_ToInteger(sfIpAddress address)
|
||||
sfUint32 sfIpAddress_toInteger(sfIpAddress address)
|
||||
{
|
||||
return ToSFMLAddress(address).ToInteger();
|
||||
return toSFMLAddress(address).toInteger();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_GetLocalAddress(void)
|
||||
sfIpAddress sfIpAddress_getLocalAddress(void)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress::GetLocalAddress());
|
||||
return fromSFMLAddress(sf::IpAddress::getLocalAddress());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_GetPublicAddress(sfTime timeout)
|
||||
sfIpAddress sfIpAddress_getPublicAddress(sfTime timeout)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress::GetPublicAddress(sf::Microseconds(timeout.Microseconds)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_None(void)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress::None);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_LocalHost(void)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress::LocalHost);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfIpAddress_Broadcast(void)
|
||||
{
|
||||
return FromSFMLAddress(sf::IpAddress::Broadcast);
|
||||
return fromSFMLAddress(sf::IpAddress::getPublicAddress(sf::microseconds(timeout.microseconds)));
|
||||
}
|
||||
+38
-38
@@ -31,14 +31,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfPacket* sfPacket_Create(void)
|
||||
sfPacket* sfPacket_create(void)
|
||||
{
|
||||
return new sfPacket;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfPacket* sfPacket_Copy(sfPacket* packet)
|
||||
sfPacket* sfPacket_copy(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, NULL);
|
||||
|
||||
@@ -47,49 +47,49 @@ sfPacket* sfPacket_Copy(sfPacket* packet)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfPacket_Destroy(sfPacket* packet)
|
||||
void sfPacket_destroy(sfPacket* packet)
|
||||
{
|
||||
delete packet;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfPacket_Append(sfPacket* packet, const void* data, size_t sizeInBytes)
|
||||
void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes)
|
||||
{
|
||||
CSFML_CALL(packet, Append(data, sizeInBytes));
|
||||
CSFML_CALL(packet, append(data, sizeInBytes));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfPacket_Clear(sfPacket* packet)
|
||||
void sfPacket_clear(sfPacket* packet)
|
||||
{
|
||||
CSFML_CALL(packet, Clear());
|
||||
CSFML_CALL(packet, clear());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfPacket_GetData(const sfPacket* packet)
|
||||
const char* sfPacket_getData(const sfPacket* packet)
|
||||
{
|
||||
CSFML_CALL_RETURN(packet, GetData(), NULL);
|
||||
CSFML_CALL_RETURN(packet, getData(), NULL);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
size_t sfPacket_GetDataSize(const sfPacket* packet)
|
||||
size_t sfPacket_getDataSize(const sfPacket* packet)
|
||||
{
|
||||
CSFML_CALL_RETURN(packet, GetDataSize(), 0);
|
||||
CSFML_CALL_RETURN(packet, getDataSize(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfPacket_EndOfPacket(const sfPacket* packet)
|
||||
sfBool sfPacket_endOfPacket(const sfPacket* packet)
|
||||
{
|
||||
CSFML_CALL_RETURN(packet, EndOfPacket(), sfFalse);
|
||||
CSFML_CALL_RETURN(packet, endOfPacket(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfPacket_CanRead(const sfPacket* packet)
|
||||
sfBool sfPacket_canRead(const sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
return packet->This ? sfTrue : sfFalse;
|
||||
@@ -97,73 +97,73 @@ sfBool sfPacket_CanRead(const sfPacket* packet)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfPacket_ReadBool(sfPacket* packet)
|
||||
sfBool sfPacket_readBool(sfPacket* packet)
|
||||
{
|
||||
return sfPacket_ReadUint8(packet);
|
||||
return sfPacket_readUint8(packet);
|
||||
}
|
||||
sfInt8 sfPacket_ReadInt8(sfPacket* packet)
|
||||
sfInt8 sfPacket_readInt8(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
sfInt8 value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
sfUint8 sfPacket_ReadUint8(sfPacket* packet)
|
||||
sfUint8 sfPacket_readUint8(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
sfUint8 value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
sfInt16 sfPacket_ReadInt16(sfPacket* packet)
|
||||
sfInt16 sfPacket_readInt16(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
sfInt16 value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
sfUint16 sfPacket_ReadUint16(sfPacket* packet)
|
||||
sfUint16 sfPacket_readUint16(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
sfUint16 value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
sfInt32 sfPacket_ReadInt32(sfPacket* packet)
|
||||
sfInt32 sfPacket_readInt32(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
sfInt32 value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
sfUint32 sfPacket_ReadUint32(sfPacket* packet)
|
||||
sfUint32 sfPacket_readUint32(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
sfUint32 value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
float sfPacket_ReadFloat(sfPacket* packet)
|
||||
float sfPacket_readFloat(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
float value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
double sfPacket_ReadDouble(sfPacket* packet)
|
||||
double sfPacket_readDouble(sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(packet, sfFalse);
|
||||
double value;
|
||||
packet->This >> value;
|
||||
return value;
|
||||
}
|
||||
void sfPacket_ReadString(sfPacket* packet, char* string)
|
||||
void sfPacket_readString(sfPacket* packet, char* string)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
if (string)
|
||||
packet->This >> string;
|
||||
}
|
||||
void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string)
|
||||
void sfPacket_readWideString(sfPacket* packet, wchar_t* string)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
if (string)
|
||||
@@ -172,58 +172,58 @@ void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfPacket_WriteBool(sfPacket* packet, sfBool value)
|
||||
void sfPacket_writeBool(sfPacket* packet, sfBool value)
|
||||
{
|
||||
sfPacket_WriteUint8(packet, value ? 1 : 0);
|
||||
sfPacket_writeUint8(packet, value ? 1 : 0);
|
||||
}
|
||||
void sfPacket_WriteInt8(sfPacket* packet, sfInt8 value)
|
||||
void sfPacket_writeInt8(sfPacket* packet, sfInt8 value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteUint8(sfPacket* packet, sfUint8 value)
|
||||
void sfPacket_writeUint8(sfPacket* packet, sfUint8 value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteInt16(sfPacket* packet, sfInt16 value)
|
||||
void sfPacket_writeInt16(sfPacket* packet, sfInt16 value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteUint16(sfPacket* packet, sfUint16 value)
|
||||
void sfPacket_writeUint16(sfPacket* packet, sfUint16 value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteInt32(sfPacket* packet, sfInt32 value)
|
||||
void sfPacket_writeInt32(sfPacket* packet, sfInt32 value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteUint32(sfPacket* packet, sfUint32 value)
|
||||
void sfPacket_writeUint32(sfPacket* packet, sfUint32 value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteFloat(sfPacket* packet, float value)
|
||||
void sfPacket_writeFloat(sfPacket* packet, float value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteDouble(sfPacket* packet, double value)
|
||||
void sfPacket_writeDouble(sfPacket* packet, double value)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
packet->This << value;
|
||||
}
|
||||
void sfPacket_WriteString(sfPacket* packet, const char* string)
|
||||
void sfPacket_writeString(sfPacket* packet, const char* string)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
|
||||
if (string)
|
||||
packet->This << string;
|
||||
}
|
||||
void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string)
|
||||
void sfPacket_writeWideString(sfPacket* packet, const wchar_t* string)
|
||||
{
|
||||
CSFML_CHECK(packet);
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketSelector* sfSocketSelector_Create(void)
|
||||
sfSocketSelector* sfSocketSelector_create(void)
|
||||
{
|
||||
return new sfSocketSelector;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketSelector* sfSocketSelector_Copy(sfSocketSelector* selector)
|
||||
sfSocketSelector* sfSocketSelector_copy(sfSocketSelector* selector)
|
||||
{
|
||||
CSFML_CHECK_RETURN(selector, NULL);
|
||||
|
||||
@@ -50,75 +50,75 @@ sfSocketSelector* sfSocketSelector_Copy(sfSocketSelector* selector)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSocketSelector_Destroy(sfSocketSelector* selector)
|
||||
void sfSocketSelector_destroy(sfSocketSelector* selector)
|
||||
{
|
||||
delete selector;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSocketSelector_AddTcpListener(sfSocketSelector* selector, sfTcpListener* socket)
|
||||
void sfSocketSelector_addTcpListener(sfSocketSelector* selector, sfTcpListener* socket)
|
||||
{
|
||||
CSFML_CHECK(socket);
|
||||
CSFML_CALL(selector, Add(socket->This));
|
||||
CSFML_CALL(selector, add(socket->This));
|
||||
}
|
||||
void sfSocketSelector_AddTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket)
|
||||
void sfSocketSelector_addTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CHECK(socket);
|
||||
CSFML_CALL(selector, Add(socket->This));
|
||||
CSFML_CALL(selector, add(socket->This));
|
||||
}
|
||||
void sfSocketSelector_AddUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket)
|
||||
void sfSocketSelector_addUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket)
|
||||
{
|
||||
CSFML_CHECK(socket);
|
||||
CSFML_CALL(selector, Add(socket->This));
|
||||
CSFML_CALL(selector, add(socket->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSocketSelector_RemoveTcpListener(sfSocketSelector* selector, sfTcpListener* socket)
|
||||
void sfSocketSelector_removeTcpListener(sfSocketSelector* selector, sfTcpListener* socket)
|
||||
{
|
||||
CSFML_CHECK(socket);
|
||||
CSFML_CALL(selector, Remove(socket->This));
|
||||
CSFML_CALL(selector, remove(socket->This));
|
||||
}
|
||||
void sfSocketSelector_RemoveTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket)
|
||||
void sfSocketSelector_removeTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CHECK(socket);
|
||||
CSFML_CALL(selector, Remove(socket->This));
|
||||
CSFML_CALL(selector, remove(socket->This));
|
||||
}
|
||||
void sfSocketSelector_RemoveUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket)
|
||||
void sfSocketSelector_removeUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket)
|
||||
{
|
||||
CSFML_CHECK(socket);
|
||||
CSFML_CALL(selector, Remove(socket->This));
|
||||
CSFML_CALL(selector, remove(socket->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSocketSelector_Clear(sfSocketSelector* selector)
|
||||
void sfSocketSelector_clear(sfSocketSelector* selector)
|
||||
{
|
||||
CSFML_CALL(selector, Clear());
|
||||
CSFML_CALL(selector, clear());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfTime timeout)
|
||||
sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout)
|
||||
{
|
||||
CSFML_CALL_RETURN(selector, Wait(sf::Microseconds(timeout.Microseconds)), sfFalse);
|
||||
CSFML_CALL_RETURN(selector, wait(sf::microseconds(timeout.microseconds)), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSocketSelector_IsTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket)
|
||||
sfBool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfFalse);
|
||||
CSFML_CALL_RETURN(selector, IsReady(socket->This), sfFalse);
|
||||
CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse);
|
||||
}
|
||||
sfBool sfSocketSelector_IsTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket)
|
||||
sfBool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfFalse);
|
||||
CSFML_CALL_RETURN(selector, IsReady(socket->This), sfFalse);
|
||||
CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse);
|
||||
}
|
||||
sfBool sfSocketSelector_IsUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket)
|
||||
sfBool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfFalse);
|
||||
CSFML_CALL_RETURN(selector, IsReady(socket->This), sfFalse);
|
||||
CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse);
|
||||
}
|
||||
@@ -32,55 +32,55 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTcpListener* sfTcpListener_Create(void)
|
||||
sfTcpListener* sfTcpListener_create(void)
|
||||
{
|
||||
return new sfTcpListener;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTcpListener_Destroy(sfTcpListener* listener)
|
||||
void sfTcpListener_destroy(sfTcpListener* listener)
|
||||
{
|
||||
delete listener;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTcpListener_SetBlocking(sfTcpListener* listener, sfBool blocking)
|
||||
void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking)
|
||||
{
|
||||
CSFML_CALL(listener, SetBlocking(blocking == sfTrue));
|
||||
CSFML_CALL(listener, setBlocking(blocking == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfTcpListener_IsBlocking(const sfTcpListener* listener)
|
||||
sfBool sfTcpListener_isBlocking(const sfTcpListener* listener)
|
||||
{
|
||||
CSFML_CALL_RETURN(listener, IsBlocking(), sfFalse);
|
||||
CSFML_CALL_RETURN(listener, isBlocking(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned short sfTcpListener_GetLocalPort(const sfTcpListener* listener)
|
||||
unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener)
|
||||
{
|
||||
CSFML_CALL_RETURN(listener, GetLocalPort(), 0);
|
||||
CSFML_CALL_RETURN(listener, getLocalPort(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpListener_Listen(sfTcpListener* listener, unsigned short port)
|
||||
sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port)
|
||||
{
|
||||
CSFML_CHECK_RETURN(listener, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(listener->This.Listen(port));
|
||||
return static_cast<sfSocketStatus>(listener->This.listen(port));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpListener_Accept(sfTcpListener* listener, sfTcpSocket** connected)
|
||||
sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** connected)
|
||||
{
|
||||
CSFML_CHECK_RETURN(listener, sfSocketError);
|
||||
CSFML_CHECK_RETURN(connected, sfSocketError);
|
||||
|
||||
*connected = new sfTcpSocket;
|
||||
return static_cast<sfSocketStatus>(listener->This.Accept((*connected)->This));
|
||||
return static_cast<sfSocketStatus>(listener->This.accept((*connected)->This));
|
||||
}
|
||||
@@ -34,119 +34,119 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTcpSocket* sfTcpSocket_Create(void)
|
||||
sfTcpSocket* sfTcpSocket_create(void)
|
||||
{
|
||||
return new sfTcpSocket;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTcpSocket_Destroy(sfTcpSocket* socket)
|
||||
void sfTcpSocket_destroy(sfTcpSocket* socket)
|
||||
{
|
||||
delete socket;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTcpSocket_SetBlocking(sfTcpSocket* socket, sfBool blocking)
|
||||
void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking)
|
||||
{
|
||||
CSFML_CALL(socket, SetBlocking(blocking == sfTrue));
|
||||
CSFML_CALL(socket, setBlocking(blocking == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfTcpSocket_IsBlocking(const sfTcpSocket* socket)
|
||||
sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CALL_RETURN(socket, IsBlocking(), sfFalse);
|
||||
CSFML_CALL_RETURN(socket, isBlocking(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned short sfTcpSocket_GetLocalPort(const sfTcpSocket* socket)
|
||||
unsigned short sfTcpSocket_getLocalPort(const sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CALL_RETURN(socket, GetLocalPort(), 0);
|
||||
CSFML_CALL_RETURN(socket, getLocalPort(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfIpAddress sfTcpSocket_GetRemoteAddress(const sfTcpSocket* socket)
|
||||
sfIpAddress sfTcpSocket_getRemoteAddress(const sfTcpSocket* socket)
|
||||
{
|
||||
sfIpAddress result = sfIpAddress_None();
|
||||
sfIpAddress result = sfIpAddress_None;
|
||||
CSFML_CHECK_RETURN(socket, result);
|
||||
|
||||
sf::IpAddress address = socket->This.GetRemoteAddress();
|
||||
strncpy(result.Address, address.ToString().c_str(), 16);
|
||||
sf::IpAddress address = socket->This.getRemoteAddress();
|
||||
strncpy(result.address, address.toString().c_str(), 16);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* socket)
|
||||
unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CALL_RETURN(socket, GetRemotePort(), 0);
|
||||
CSFML_CALL_RETURN(socket, getRemotePort(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout)
|
||||
sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout)
|
||||
{
|
||||
sf::IpAddress address(host.Address);
|
||||
sf::IpAddress address(host.address);
|
||||
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Connect(address, port, sf::Microseconds(timeout.Microseconds)));
|
||||
return static_cast<sfSocketStatus>(socket->This.connect(address, port, sf::microseconds(timeout.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTcpSocket_Disconnect(sfTcpSocket* socket)
|
||||
void sfTcpSocket_disconnect(sfTcpSocket* socket)
|
||||
{
|
||||
CSFML_CALL(socket, Disconnect());
|
||||
CSFML_CALL(socket, disconnect());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_Send(sfTcpSocket* socket, const char* data, size_t size)
|
||||
sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const char* data, size_t size)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Send(data, size));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_Receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived)
|
||||
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
if (sizeReceived)
|
||||
{
|
||||
return static_cast<sfSocketStatus>(socket->This.Receive(data, maxSize, *sizeReceived));
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, maxSize, *sizeReceived));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::size_t size = 0;
|
||||
return static_cast<sfSocketStatus>(socket->This.Receive(data, maxSize, size));
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, maxSize, size));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_SendPacket(sfTcpSocket* socket, sfPacket* packet)
|
||||
sfSocketStatus sfTcpSocket_sendPacket(sfTcpSocket* socket, sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Send(packet->This));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(packet->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_ReceivePacket(sfTcpSocket* socket, sfPacket* packet)
|
||||
sfSocketStatus sfTcpSocket_receivePacket(sfTcpSocket* socket, sfPacket* packet)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Receive(packet->This));
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(packet->This));
|
||||
}
|
||||
@@ -34,69 +34,69 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfUdpSocket* sfUdpSocket_Create(void)
|
||||
sfUdpSocket* sfUdpSocket_create(void)
|
||||
{
|
||||
return new sfUdpSocket;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfUdpSocket_Destroy(sfUdpSocket* socket)
|
||||
void sfUdpSocket_destroy(sfUdpSocket* socket)
|
||||
{
|
||||
delete socket;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfUdpSocket_SetBlocking(sfUdpSocket* socket, sfBool blocking)
|
||||
void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking)
|
||||
{
|
||||
CSFML_CALL(socket, SetBlocking(blocking == sfTrue));
|
||||
CSFML_CALL(socket, setBlocking(blocking == sfTrue));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfUdpSocket_IsBlocking(const sfUdpSocket* socket)
|
||||
sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket)
|
||||
{
|
||||
CSFML_CALL_RETURN(socket, IsBlocking(), sfFalse);
|
||||
CSFML_CALL_RETURN(socket, isBlocking(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned short sfUdpSocket_GetLocalPort(const sfUdpSocket* socket)
|
||||
unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket)
|
||||
{
|
||||
CSFML_CALL_RETURN(socket, GetLocalPort(), 0);
|
||||
CSFML_CALL_RETURN(socket, getLocalPort(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_Bind(sfUdpSocket* socket, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Bind(port));
|
||||
return static_cast<sfSocketStatus>(socket->This.bind(port));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfUdpSocket_Unbind(sfUdpSocket* socket)
|
||||
void sfUdpSocket_unbind(sfUdpSocket* socket)
|
||||
{
|
||||
CSFML_CALL(socket, Unbind());
|
||||
CSFML_CALL(socket, unbind());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_Send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
// Convert the address
|
||||
sf::IpAddress receiver(address.Address);
|
||||
sf::IpAddress receiver(address.address);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Send(data, size, receiver, port));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size, receiver, port));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port)
|
||||
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
@@ -105,7 +105,7 @@ sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSi
|
||||
unsigned short senderPort;
|
||||
std::size_t received;
|
||||
|
||||
sf::Socket::Status status = socket->This.Receive(data, maxSize, received, sender, senderPort);
|
||||
sf::Socket::Status status = socket->This.receive(data, maxSize, received, sender, senderPort);
|
||||
if (status != sf::Socket::Done)
|
||||
return static_cast<sfSocketStatus>(status);
|
||||
|
||||
@@ -113,7 +113,7 @@ sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSi
|
||||
*sizeReceived = received;
|
||||
|
||||
if (address)
|
||||
strncpy(address->Address, sender.ToString().c_str(), 16);
|
||||
strncpy(address->address, sender.toString().c_str(), 16);
|
||||
|
||||
if (port)
|
||||
*port = senderPort;
|
||||
@@ -123,32 +123,32 @@ sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSi
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_SendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
// Convert the address
|
||||
sf::IpAddress receiver(address.Address);
|
||||
sf::IpAddress receiver(address.address);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.Send(packet->This, receiver, port));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(packet->This, receiver, port));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_ReceivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port)
|
||||
sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
sf::IpAddress sender;
|
||||
unsigned short senderPort;
|
||||
sf::Socket::Status status = socket->This.Receive(packet->This, sender, senderPort);
|
||||
sf::Socket::Status status = socket->This.receive(packet->This, sender, senderPort);
|
||||
if (status != sf::Socket::Done)
|
||||
return static_cast<sfSocketStatus>(status);
|
||||
|
||||
if (address)
|
||||
strncpy(address->Address, sender.ToString().c_str(), 16);
|
||||
strncpy(address->address, sender.toString().c_str(), 16);
|
||||
|
||||
if (port)
|
||||
*port = senderPort;
|
||||
@@ -158,7 +158,7 @@ sfSocketStatus sfUdpSocket_ReceivePacket(sfUdpSocket* socket, sfPacket* packet,
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfUdpSocket_MaxDatagramSize()
|
||||
unsigned int sfUdpSocket_maxDatagramSize()
|
||||
{
|
||||
return sf::UdpSocket::MaxDatagramSize;
|
||||
}
|
||||
+11
-11
@@ -31,14 +31,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfClock* sfClock_Create(void)
|
||||
sfClock* sfClock_create(void)
|
||||
{
|
||||
return new sfClock;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfClock* sfClock_Copy(sfClock* clock)
|
||||
sfClock* sfClock_copy(sfClock* clock)
|
||||
{
|
||||
CSFML_CHECK_RETURN(clock, NULL);
|
||||
|
||||
@@ -47,27 +47,27 @@ sfClock* sfClock_Copy(sfClock* clock)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfClock_Destroy(sfClock* clock)
|
||||
void sfClock_destroy(sfClock* clock)
|
||||
{
|
||||
delete clock;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfClock_GetElapsedTime(const sfClock* clock)
|
||||
sfTime sfClock_getElapsedTime(const sfClock* clock)
|
||||
{
|
||||
CSFML_CHECK_RETURN(clock, sfTimeZero);
|
||||
CSFML_CHECK_RETURN(clock, sfTime_Zero);
|
||||
|
||||
sf::Time time = clock->This.GetElapsedTime();
|
||||
return sfMicroseconds(time.AsMicroseconds());
|
||||
sf::Time time = clock->This.getElapsedTime();
|
||||
return sfMicroseconds(time.asMicroseconds());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfClock_Restart(sfClock* clock)
|
||||
sfTime sfClock_restart(sfClock* clock)
|
||||
{
|
||||
CSFML_CHECK_RETURN(clock, sfTimeZero);
|
||||
CSFML_CHECK_RETURN(clock, sfTime_Zero);
|
||||
|
||||
sf::Time time = clock->This.Restart();
|
||||
return sfMicroseconds(time.AsMicroseconds());
|
||||
sf::Time time = clock->This.restart();
|
||||
return sfMicroseconds(time.asMicroseconds());
|
||||
}
|
||||
@@ -31,28 +31,28 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfMutex* sfMutex_Create(void)
|
||||
sfMutex* sfMutex_create(void)
|
||||
{
|
||||
return new sfMutex;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMutex_Destroy(sfMutex* mutex)
|
||||
void sfMutex_destroy(sfMutex* mutex)
|
||||
{
|
||||
delete mutex;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMutex_Lock(sfMutex* mutex)
|
||||
void sfMutex_lock(sfMutex* mutex)
|
||||
{
|
||||
CSFML_CALL(mutex, Lock());
|
||||
CSFML_CALL(mutex, lock());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMutex_Unlock(sfMutex* mutex)
|
||||
void sfMutex_unlock(sfMutex* mutex)
|
||||
{
|
||||
CSFML_CALL(mutex, Unlock());
|
||||
CSFML_CALL(mutex, unlock());
|
||||
}
|
||||
@@ -33,5 +33,5 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSleep(sfTime duration)
|
||||
{
|
||||
sf::Sleep(sf::Microseconds(duration.Microseconds));
|
||||
sf::sleep(sf::microseconds(duration.microseconds));
|
||||
}
|
||||
@@ -31,35 +31,35 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfThread* sfThread_Create(void (*function)(void*), void* userData)
|
||||
sfThread* sfThread_create(void (*function)(void*), void* userData)
|
||||
{
|
||||
return new sfThread(function, userData);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfThread_Destroy(sfThread* thread)
|
||||
void sfThread_destroy(sfThread* thread)
|
||||
{
|
||||
delete thread;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfThread_Launch(sfThread* thread)
|
||||
void sfThread_launch(sfThread* thread)
|
||||
{
|
||||
CSFML_CALL(thread, Launch());
|
||||
CSFML_CALL(thread, launch());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfThread_Wait(sfThread* thread)
|
||||
void sfThread_wait(sfThread* thread)
|
||||
{
|
||||
CSFML_CALL(thread, Wait());
|
||||
CSFML_CALL(thread, wait());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfThread_Terminate(sfThread* thread)
|
||||
void sfThread_terminate(sfThread* thread)
|
||||
{
|
||||
CSFML_CALL(thread, Terminate());
|
||||
CSFML_CALL(thread, terminate());
|
||||
}
|
||||
@@ -36,8 +36,8 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
struct sfThread
|
||||
{
|
||||
sfThread(void (*Function)(void*), void* UserData) :
|
||||
This(Function, UserData)
|
||||
sfThread(void (*function)(void*), void* userData) :
|
||||
This(function, userData)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -29,27 +29,27 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTime sfTimeZero = {0};
|
||||
sfTime sfTime_Zero = {0};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfTime_AsSeconds(sfTime time)
|
||||
float sfTime_asSeconds(sfTime time)
|
||||
{
|
||||
return time.Microseconds / 1000000.f;
|
||||
return time.microseconds / 1000000.f;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfInt32 sfTime_AsMilliseconds(sfTime time)
|
||||
sfInt32 sfTime_asMilliseconds(sfTime time)
|
||||
{
|
||||
return static_cast<sfUint32>(time.Microseconds / 1000);
|
||||
return static_cast<sfUint32>(time.microseconds / 1000);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfInt64 sfTime_AsMicroseconds(sfTime time)
|
||||
sfInt64 sfTime_asMicroseconds(sfTime time)
|
||||
{
|
||||
return time.Microseconds;
|
||||
return time.microseconds;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ sfInt64 sfTime_AsMicroseconds(sfTime time)
|
||||
sfTime sfSeconds(float amount)
|
||||
{
|
||||
sfTime time;
|
||||
time.Microseconds = static_cast<sfUint64>(amount * 1000000);
|
||||
time.microseconds = static_cast<sfUint64>(amount * 1000000);
|
||||
return time;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ sfTime sfSeconds(float amount)
|
||||
sfTime sfMilliseconds(sfInt32 amount)
|
||||
{
|
||||
sfTime time;
|
||||
time.Microseconds = static_cast<sfUint64>(amount) * 1000;
|
||||
time.microseconds = static_cast<sfUint64>(amount) * 1000;
|
||||
return time;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,6 @@ sfTime sfMilliseconds(sfInt32 amount)
|
||||
sfTime sfMicroseconds(sfInt64 amount)
|
||||
{
|
||||
sfTime time;
|
||||
time.Microseconds = amount;
|
||||
time.microseconds = amount;
|
||||
return time;
|
||||
}
|
||||
@@ -31,21 +31,21 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfContext* sfContext_Create(void)
|
||||
sfContext* sfContext_create(void)
|
||||
{
|
||||
return new sfContext;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfContext_Destroy(sfContext* context)
|
||||
void sfContext_destroy(sfContext* context)
|
||||
{
|
||||
delete context;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfContext_SetActive(sfContext* context, sfBool active)
|
||||
void sfContext_setActive(sfContext* context, sfBool active)
|
||||
{
|
||||
CSFML_CALL(context, SetActive(active == sfTrue));
|
||||
CSFML_CALL(context, setActive(active == sfTrue));
|
||||
}
|
||||
@@ -31,42 +31,42 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfJoystick_IsConnected(unsigned int joystick)
|
||||
sfBool sfJoystick_isConnected(unsigned int joystick)
|
||||
{
|
||||
return sf::Joystick::IsConnected(joystick) ? sfTrue : sfFalse;
|
||||
return sf::Joystick::isConnected(joystick) ? sfTrue : sfFalse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfJoystick_GetButtonCount(unsigned int joystick)
|
||||
unsigned int sfJoystick_getButtonCount(unsigned int joystick)
|
||||
{
|
||||
return sf::Joystick::GetButtonCount(joystick);
|
||||
return sf::Joystick::getButtonCount(joystick);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfJoystick_HasAxis(unsigned int joystick, sfJoystickAxis axis)
|
||||
sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis)
|
||||
{
|
||||
return sf::Joystick::HasAxis(joystick, static_cast<sf::Joystick::Axis>(axis)) ? sfTrue : sfFalse;
|
||||
return sf::Joystick::hasAxis(joystick, static_cast<sf::Joystick::Axis>(axis)) ? sfTrue : sfFalse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfJoystick_IsButtonPressed(unsigned int joystick, unsigned int button)
|
||||
sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button)
|
||||
{
|
||||
return sf::Joystick::IsButtonPressed(joystick, button) ? sfTrue : sfFalse;
|
||||
return sf::Joystick::isButtonPressed(joystick, button) ? sfTrue : sfFalse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfJoystick_GetAxisPosition(unsigned int joystick, sfJoystickAxis axis)
|
||||
float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis)
|
||||
{
|
||||
return sf::Joystick::GetAxisPosition(joystick, static_cast<sf::Joystick::Axis>(axis));
|
||||
return sf::Joystick::getAxisPosition(joystick, static_cast<sf::Joystick::Axis>(axis));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfJoystick_Update(void)
|
||||
void sfJoystick_update(void)
|
||||
{
|
||||
sf::Joystick::Update();
|
||||
sf::Joystick::update();
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfKeyboard_IsKeyPressed(sfKeyCode key)
|
||||
sfBool sfKeyboard_isKeyPressed(sfKeyCode key)
|
||||
{
|
||||
return sf::Keyboard::IsKeyPressed(static_cast<sf::Keyboard::Key>(key));
|
||||
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Key>(key));
|
||||
}
|
||||
@@ -32,20 +32,20 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfMouse_IsButtonPressed(sfMouseButton button)
|
||||
sfBool sfMouse_isButtonPressed(sfMouseButton button)
|
||||
{
|
||||
return sf::Mouse::IsButtonPressed(static_cast<sf::Mouse::Button>(button)) ? sfTrue : sfFalse;
|
||||
return sf::Mouse::isButtonPressed(static_cast<sf::Mouse::Button>(button)) ? sfTrue : sfFalse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2i sfMouse_GetPosition(const sfWindow* relativeTo)
|
||||
sfVector2i sfMouse_getPosition(const sfWindow* relativeTo)
|
||||
{
|
||||
sf::Vector2i sfmlPos;
|
||||
if (relativeTo)
|
||||
sfmlPos = sf::Mouse::GetPosition(relativeTo->This);
|
||||
sfmlPos = sf::Mouse::getPosition(relativeTo->This);
|
||||
else
|
||||
sfmlPos = sf::Mouse::GetPosition();
|
||||
sfmlPos = sf::Mouse::getPosition();
|
||||
|
||||
sfVector2i position = {sfmlPos.x, sfmlPos.y};
|
||||
return position;
|
||||
@@ -53,10 +53,10 @@ sfVector2i sfMouse_GetPosition(const sfWindow* relativeTo)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMouse_SetPosition(sfVector2i position, const sfWindow* relativeTo)
|
||||
void sfMouse_setPosition(sfVector2i position, const sfWindow* relativeTo)
|
||||
{
|
||||
if (relativeTo)
|
||||
sf::Mouse::SetPosition(sf::Vector2i(position.x, position.y), relativeTo->This);
|
||||
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y), relativeTo->This);
|
||||
else
|
||||
sf::Mouse::SetPosition(sf::Vector2i(position.x, position.y));
|
||||
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y));
|
||||
}
|
||||
@@ -31,33 +31,33 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVideoMode sfVideoMode_GetDesktopMode(void)
|
||||
sfVideoMode sfVideoMode_getDesktopMode(void)
|
||||
{
|
||||
sf::VideoMode desktop = sf::VideoMode::GetDesktopMode();
|
||||
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
|
||||
sfVideoMode ret;
|
||||
ret.Width = desktop.Width;
|
||||
ret.Height = desktop.Height;
|
||||
ret.BitsPerPixel = desktop.BitsPerPixel;
|
||||
ret.width = desktop.width;
|
||||
ret.height = desktop.height;
|
||||
ret.bitsPerPixel = desktop.bitsPerPixel;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfVideoMode* sfVideoMode_GetFullscreenModes(size_t* count)
|
||||
const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count)
|
||||
{
|
||||
static std::vector<sfVideoMode> modes;
|
||||
|
||||
// Populate the array on first call
|
||||
if (modes.empty())
|
||||
{
|
||||
const std::vector<sf::VideoMode>& SFMLModes = sf::VideoMode::GetFullscreenModes();
|
||||
const std::vector<sf::VideoMode>& SFMLModes = sf::VideoMode::getFullscreenModes();
|
||||
for (std::vector<sf::VideoMode>::const_iterator it = SFMLModes.begin(); it != SFMLModes.end(); ++it)
|
||||
{
|
||||
sfVideoMode mode;
|
||||
mode.Width = it->Width;
|
||||
mode.Height = it->Height;
|
||||
mode.BitsPerPixel = it->BitsPerPixel;
|
||||
mode.width = it->width;
|
||||
mode.height = it->height;
|
||||
mode.bitsPerPixel = it->bitsPerPixel;
|
||||
modes.push_back(mode);
|
||||
}
|
||||
}
|
||||
@@ -70,8 +70,8 @@ const sfVideoMode* sfVideoMode_GetFullscreenModes(size_t* count)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfVideoMode_IsValid(sfVideoMode mode)
|
||||
sfBool sfVideoMode_isValid(sfVideoMode mode)
|
||||
{
|
||||
sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel);
|
||||
return videoMode.IsValid() ? sfTrue : sfFalse;
|
||||
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
|
||||
return videoMode.isValid() ? sfTrue : sfFalse;
|
||||
}
|
||||
+62
-62
@@ -32,138 +32,138 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings)
|
||||
sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings)
|
||||
{
|
||||
// Convert video mode
|
||||
sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel);
|
||||
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
|
||||
|
||||
// Convert context settings
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.DepthBits = settings->DepthBits;
|
||||
params.StencilBits = settings->StencilBits;
|
||||
params.AntialiasingLevel = settings->AntialiasingLevel;
|
||||
params.MajorVersion = settings->MajorVersion;
|
||||
params.MinorVersion = settings->MinorVersion;
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
}
|
||||
|
||||
// Create the window
|
||||
sfWindow* window = new sfWindow;
|
||||
window->This.Create(videoMode, title, style, params);
|
||||
window->This.create(videoMode, title, style, params);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings)
|
||||
sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings)
|
||||
{
|
||||
// Convert context settings
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.DepthBits = settings->DepthBits;
|
||||
params.StencilBits = settings->StencilBits;
|
||||
params.AntialiasingLevel = settings->AntialiasingLevel;
|
||||
params.MajorVersion = settings->MajorVersion;
|
||||
params.MinorVersion = settings->MinorVersion;
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
}
|
||||
|
||||
// Create the window
|
||||
sfWindow* window = new sfWindow;
|
||||
window->This.Create(handle, params);
|
||||
window->This.create(handle, params);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_Destroy(sfWindow* window)
|
||||
void sfWindow_destroy(sfWindow* window)
|
||||
{
|
||||
delete window;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_Close(sfWindow* window)
|
||||
void sfWindow_close(sfWindow* window)
|
||||
{
|
||||
CSFML_CALL(window, Close());
|
||||
CSFML_CALL(window, close());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfWindow_IsOpen(const sfWindow* window)
|
||||
sfBool sfWindow_isOpen(const sfWindow* window)
|
||||
{
|
||||
CSFML_CALL_RETURN(window, IsOpen(), sfFalse);
|
||||
CSFML_CALL_RETURN(window, isOpen(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfContextSettings sfWindow_GetSettings(const sfWindow* window)
|
||||
sfContextSettings sfWindow_getSettings(const sfWindow* window)
|
||||
{
|
||||
sfContextSettings settings = {0, 0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(window, settings);
|
||||
|
||||
const sf::ContextSettings& params = window->This.GetSettings();
|
||||
settings.DepthBits = params.DepthBits;
|
||||
settings.StencilBits = params.StencilBits;
|
||||
settings.AntialiasingLevel = params.AntialiasingLevel;
|
||||
settings.MajorVersion = params.MajorVersion;
|
||||
settings.MinorVersion = params.MinorVersion;
|
||||
const sf::ContextSettings& params = window->This.getSettings();
|
||||
settings.depthBits = params.depthBits;
|
||||
settings.stencilBits = params.stencilBits;
|
||||
settings.antialiasingLevel = params.antialiasingLevel;
|
||||
settings.majorVersion = params.majorVersion;
|
||||
settings.minorVersion = params.minorVersion;
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfWindow_PollEvent(sfWindow* window, sfEvent* event)
|
||||
sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event)
|
||||
{
|
||||
CSFML_CHECK_RETURN(window, sfFalse);
|
||||
CSFML_CHECK_RETURN(event, sfFalse);
|
||||
|
||||
// Get the event
|
||||
sf::Event SFMLEvent;
|
||||
sfBool ret = window->This.PollEvent(SFMLEvent);
|
||||
sfBool ret = window->This.pollEvent(SFMLEvent);
|
||||
|
||||
// No event, return
|
||||
if (!ret)
|
||||
return sfFalse;
|
||||
|
||||
// Convert the sf::Event event to a sfEvent
|
||||
ConvertEvent(SFMLEvent, event);
|
||||
convertEvent(SFMLEvent, event);
|
||||
|
||||
return sfTrue;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfWindow_WaitEvent(sfWindow* window, sfEvent* event)
|
||||
sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event)
|
||||
{
|
||||
CSFML_CHECK_RETURN(window, sfFalse);
|
||||
CSFML_CHECK_RETURN(event, sfFalse);
|
||||
|
||||
// Get the event
|
||||
sf::Event SFMLEvent;
|
||||
sfBool ret = window->This.WaitEvent(SFMLEvent);
|
||||
sfBool ret = window->This.waitEvent(SFMLEvent);
|
||||
|
||||
// Error, return
|
||||
if (!ret)
|
||||
return sfFalse;
|
||||
|
||||
// Convert the sf::Event event to a sfEvent
|
||||
ConvertEvent(SFMLEvent, event);
|
||||
convertEvent(SFMLEvent, event);
|
||||
|
||||
return sfTrue;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2i sfWindow_GetPosition(const sfWindow* window)
|
||||
sfVector2i sfWindow_getPosition(const sfWindow* window)
|
||||
{
|
||||
sfVector2i position = {0, 0};
|
||||
CSFML_CHECK_RETURN(window, position);
|
||||
|
||||
sf::Vector2i sfmlPos = window->This.GetPosition();
|
||||
sf::Vector2i sfmlPos = window->This.getPosition();
|
||||
position.x = sfmlPos.x;
|
||||
position.y = sfmlPos.y;
|
||||
|
||||
@@ -172,19 +172,19 @@ sfVector2i sfWindow_GetPosition(const sfWindow* window)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetPosition(sfWindow* window, sfVector2i position)
|
||||
void sfWindow_setPosition(sfWindow* window, sfVector2i position)
|
||||
{
|
||||
CSFML_CALL(window, SetPosition(sf::Vector2i(position.x, position.y)));
|
||||
CSFML_CALL(window, setPosition(sf::Vector2i(position.x, position.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2u sfWindow_GetSize(const sfWindow* window)
|
||||
sfVector2u sfWindow_getSize(const sfWindow* window)
|
||||
{
|
||||
sfVector2u size = {0, 0};
|
||||
CSFML_CHECK_RETURN(window, size);
|
||||
|
||||
sf::Vector2u sfmlSize = window->This.GetSize();
|
||||
sf::Vector2u sfmlSize = window->This.getSize();
|
||||
size.x = sfmlSize.x;
|
||||
size.y = sfmlSize.y;
|
||||
|
||||
@@ -195,84 +195,84 @@ sfVector2u sfWindow_GetSize(const sfWindow* window)
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetSize(sfWindow* window, sfVector2u size)
|
||||
{
|
||||
CSFML_CALL(window, SetSize(sf::Vector2u(size.x, size.y)));
|
||||
CSFML_CALL(window, setSize(sf::Vector2u(size.x, size.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetTitle(sfWindow* window, const char* title)
|
||||
void sfWindow_setTitle(sfWindow* window, const char* title)
|
||||
{
|
||||
CSFML_CALL(window, SetTitle(title));
|
||||
CSFML_CALL(window, setTitle(title));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels)
|
||||
void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels)
|
||||
{
|
||||
CSFML_CALL(window, SetIcon(width, height, pixels));
|
||||
CSFML_CALL(window, setIcon(width, height, pixels));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetVisible(sfWindow* window, sfBool visible)
|
||||
void sfWindow_setVisible(sfWindow* window, sfBool visible)
|
||||
{
|
||||
CSFML_CALL(window, SetVisible(visible == sfTrue));
|
||||
CSFML_CALL(window, setVisible(visible == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetMouseCursorVisible(sfWindow* window, sfBool visible)
|
||||
void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible)
|
||||
{
|
||||
CSFML_CALL(window, SetMouseCursorVisible(visible == sfTrue));
|
||||
CSFML_CALL(window, setMouseCursorVisible(visible == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetVerticalSyncEnabled(sfWindow* window, sfBool enabled)
|
||||
void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled)
|
||||
{
|
||||
CSFML_CALL(window, SetVerticalSyncEnabled(enabled == sfTrue));
|
||||
CSFML_CALL(window, setVerticalSyncEnabled(enabled == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetKeyRepeatEnabled(sfWindow* window, sfBool enabled)
|
||||
void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled)
|
||||
{
|
||||
CSFML_CALL(window, SetKeyRepeatEnabled(enabled == sfTrue));
|
||||
CSFML_CALL(window, setKeyRepeatEnabled(enabled == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfWindow_SetActive(sfWindow* window, sfBool active)
|
||||
sfBool sfWindow_setActive(sfWindow* window, sfBool active)
|
||||
{
|
||||
CSFML_CALL_RETURN(window, SetActive(active == sfTrue), sfFalse);
|
||||
CSFML_CALL_RETURN(window, setActive(active == sfTrue), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_Display(sfWindow* window)
|
||||
void sfWindow_display(sfWindow* window)
|
||||
{
|
||||
CSFML_CALL(window, Display());
|
||||
CSFML_CALL(window, display());
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit)
|
||||
void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit)
|
||||
{
|
||||
CSFML_CALL(window, SetFramerateLimit(limit));
|
||||
CSFML_CALL(window, setFramerateLimit(limit));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_SetJoystickThreshold(sfWindow* window, float threshold)
|
||||
void sfWindow_setJoystickThreshold(sfWindow* window, float threshold)
|
||||
{
|
||||
CSFML_CALL(window, SetJoystickThreshold(threshold));
|
||||
CSFML_CALL(window, setJoystickThreshold(threshold));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfWindowHandle sfWindow_GetSystemHandle(const sfWindow* window)
|
||||
sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window)
|
||||
{
|
||||
CSFML_CHECK_RETURN(window, NULL);
|
||||
|
||||
return (sfWindowHandle)window->This.GetSystemHandle();
|
||||
return (sfWindowHandle)window->This.getSystemHandle();
|
||||
}
|
||||
Reference in new issue
Block a user