Use C standard library utilities for booleans and fixed-width ints

This commit is contained in:
Chris Thrasher authored and Lukas Dürrenberger committed 2024-02-19 23:30:30 +01:00
1 parent 46bc9a7ed8
commit a51c22a7a3
97 files changed
+670 -707

No files matched your search

+2 -2
View File
@@ -19,8 +19,8 @@ macro(csfml_add_library target)
# add warnings
set_file_warnings(${THIS_SOURCES})
# require C++17
target_compile_features(${target} PUBLIC cxx_std_17)
# require C99 and C++17
target_compile_features(${target} PUBLIC c_std_99 cxx_std_17)
# define the export symbol of the module
string(REPLACE "-" "_" NAME_UPPER "${target}")
+1 -1
View File
@@ -36,7 +36,7 @@
/// if (!texture)
/// return EXIT_FAILURE;
/// sprite = sfSprite_create();
/// sfSprite_setTexture(sprite, texture, sfTrue);
/// sfSprite_setTexture(sprite, texture, true);
///
/// /* Create a graphical text to display */
/// font = sfFont_createFromFile("arial.ttf");
+1 -1
View File
@@ -19,7 +19,7 @@ int main(void)
return EXIT_FAILURE;
}
sfSprite* sprite = sfSprite_create();
sfSprite_setTexture(sprite, texture, sfTrue);
sfSprite_setTexture(sprite, texture, true);
const sfVector2f spritePosition = {200, 200};
sfSprite_setPosition(sprite, spritePosition);
+9 -9
View File
@@ -110,24 +110,24 @@ CSFML_AUDIO_API void sfMusic_destroy(sfMusic* music);
///
/// If set, the music will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfMusic_setLoop(music, sfFalse) is called.
/// sfMusic_setLoop(music, false) is called.
/// The default looping state for musics is false.
///
/// \param music Music object
/// \param loop sfTrue to play in loop, sfFalse to play once
/// \param loop true to play in loop, false to play once
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_setLoop(sfMusic* music, sfBool loop);
CSFML_AUDIO_API void sfMusic_setLoop(sfMusic* music, bool loop);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a music is in loop mode
///
/// \param music Music object
///
/// \return sfTrue if the music is looping, sfFalse otherwise
/// \return true if the music is looping, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfMusic_getLoop(const sfMusic* music);
CSFML_AUDIO_API bool sfMusic_getLoop(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the total duration of a music
@@ -310,10 +310,10 @@ CSFML_AUDIO_API void sfMusic_setPosition(sfMusic* music, sfVector3f position);
/// The default value is false (position is absolute).
///
/// \param music Music object
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
/// \param relative true to set the position relative, false to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative);
CSFML_AUDIO_API void sfMusic_setRelativeToListener(sfMusic* music, bool relative);
////////////////////////////////////////////////////////////
/// \brief Set the minimum distance of a music
@@ -397,10 +397,10 @@ CSFML_AUDIO_API sfVector3f sfMusic_getPosition(const sfMusic* music);
///
/// \param music Music object
///
/// \return sfTrue if the position is relative, sfFalse if it's absolute
/// \return true if the position is relative, false if it's absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfMusic_isRelativeToListener(const sfMusic* music);
CSFML_AUDIO_API bool sfMusic_isRelativeToListener(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the minimum distance of a music
+9 -9
View File
@@ -126,24 +126,24 @@ CSFML_AUDIO_API const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound);
///
/// If set, the sound will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfSound_setLoop(sound, sfFalse) is called.
/// sfSound_setLoop(sound, false) is called.
/// The default looping state for sounds is false.
///
/// \param sound Sound object
/// \param loop sfTrue to play in loop, sfFalse to play once
/// \param loop true to play in loop, false to play once
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, sfBool loop);
CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, bool loop);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a sound is in loop mode
///
/// \param sound Sound object
///
/// \return sfTrue if the sound is looping, sfFalse otherwise
/// \return true if the sound is looping, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSound_getLoop(const sfSound* sound);
CSFML_AUDIO_API bool sfSound_getLoop(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the current status of a sound (stopped, paused, playing)
@@ -205,10 +205,10 @@ CSFML_AUDIO_API void sfSound_setPosition(sfSound* sound, sfVector3f position);
/// The default value is false (position is absolute).
///
/// \param sound Sound object
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
/// \param relative true to set the position relative, false to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_setRelativeToListener(sfSound* sound, sfBool relative);
CSFML_AUDIO_API void sfSound_setRelativeToListener(sfSound* sound, bool relative);
////////////////////////////////////////////////////////////
/// \brief Set the minimum distance of a sound
@@ -292,10 +292,10 @@ CSFML_AUDIO_API sfVector3f sfSound_getPosition(const sfSound* sound);
///
/// \param sound Sound object
///
/// \return sfTrue if the position is relative, sfFalse if it's absolute
/// \return true if the position is relative, false if it's absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound);
CSFML_AUDIO_API bool sfSound_isRelativeToListener(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the minimum distance of a sound
+7 -7
View File
@@ -82,7 +82,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str
/// \brief Create a new sound buffer and load it from an array of samples in memory
///
/// The assumed format of the audio samples is 16 bits signed integer
/// (sfInt16).
/// (int16_t).
///
/// \param samples Pointer to the array of samples in memory
/// \param sampleCount Number of samples in the array
@@ -92,7 +92,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const int16_t* samples, uint64_t sampleCount, unsigned int channelCount, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer by copying an existing one
@@ -122,16 +122,16 @@ CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer);
/// \param soundBuffer Sound buffer object
/// \param filename Path of the sound file to write
///
/// \return sfTrue if saving succeeded, sfFalse if it failed
/// \return true if saving succeeded, false if it failed
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
CSFML_AUDIO_API bool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
////////////////////////////////////////////////////////////
/// \brief Get the array of audio samples stored in a sound buffer
///
/// The format of the returned samples is 16 bits signed integer
/// (sfInt16). The total number of samples in this array
/// (int16_t). The total number of samples in this array
/// is given by the sfSoundBuffer_getSampleCount function.
///
/// \param soundBuffer Sound buffer object
@@ -139,7 +139,7 @@ CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer
/// \return Read-only pointer to the array of sound samples
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API const int16_t* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Get the number of samples stored in a sound buffer
@@ -152,7 +152,7 @@ CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* sou
/// \return Number of samples
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API uint64_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of a sound buffer
+4 -4
View File
@@ -61,10 +61,10 @@ CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundB
/// \param soundBufferRecorder Sound buffer recorder object
/// \param sampleRate Desired capture rate, in number of samples per second
///
/// \return sfTrue, if it was able to start recording
/// \return true, if it was able to start recording
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
CSFML_AUDIO_API bool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Stop the capture of a sound recorder
@@ -114,10 +114,10 @@ CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSou
/// \param soundBufferRecorder Sound buffer recorder object
/// \param name The name of the audio capture device
///
/// \return sfTrue, if it was able to set the requested device
/// \return true, if it was able to set the requested device
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name);
CSFML_AUDIO_API bool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name);
////////////////////////////////////////////////////////////
/// \brief Get the name of the current audio capture device
+8 -8
View File
@@ -34,9 +34,9 @@
#include <stddef.h>
typedef sfBool (*sfSoundRecorderStartCallback)(void*); ///< Type of the callback used when starting a capture
typedef sfBool (*sfSoundRecorderProcessCallback)(const sfInt16*, size_t, void*); ///< Type of the callback used to process audio data
typedef void (*sfSoundRecorderStopCallback)(void*); ///< Type of the callback used when stopping a capture
typedef bool (*sfSoundRecorderStartCallback)(void*); ///< Type of the callback used when starting a capture
typedef bool (*sfSoundRecorderProcessCallback)(const int16_t*, size_t, void*); ///< Type of the callback used to process audio data
typedef void (*sfSoundRecorderStopCallback)(void*); ///< Type of the callback used when stopping a capture
////////////////////////////////////////////////////////////
@@ -79,7 +79,7 @@ CSFML_AUDIO_API void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder);
/// \return True, if start of capture was successful
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
CSFML_AUDIO_API bool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Stop the capture of a sound recorder
@@ -110,10 +110,10 @@ CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder
/// the audio capture features. If it returns false, then
/// any attempt to use sfSoundRecorder will fail.
///
/// \return sfTrue if audio capture is supported, sfFalse otherwise
/// \return true if audio capture is supported, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
CSFML_AUDIO_API bool sfSoundRecorder_isAvailable(void);
////////////////////////////////////////////////////////////
/// \brief Set the processing interval
@@ -170,10 +170,10 @@ CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice(void);
/// \param soundRecorder Sound recorder object
/// \param name The name of the audio capture device
///
/// \return sfTrue, if it was able to set the requested device
/// \return true, if it was able to set the requested device
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name);
CSFML_AUDIO_API bool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name);
////////////////////////////////////////////////////////////
/// \brief Get the name of the current audio capture device
+12 -12
View File
@@ -41,12 +41,12 @@
////////////////////////////////////////////////////////////
typedef struct
{
sfInt16* samples; ///< Pointer to the audio samples
int16_t* samples; ///< Pointer to the audio samples
unsigned int sampleCount; ///< Number of samples pointed by Samples
} sfSoundStreamChunk;
typedef sfBool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*); ///< Type of the callback used to get a sound stream data
typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< Type of the callback used to seek in a sound stream
typedef bool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*); ///< Type of the callback used to get a sound stream data
typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< Type of the callback used to seek in a sound stream
////////////////////////////////////////////////////////////
@@ -197,10 +197,10 @@ CSFML_AUDIO_API void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVec
/// The default value is false (position is absolute).
///
/// \param soundStream Sound stream object
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
/// \param relative true to set the position relative, false to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative);
CSFML_AUDIO_API void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, bool relative);
////////////////////////////////////////////////////////////
/// \brief Set the minimum distance of a sound stream
@@ -253,14 +253,14 @@ CSFML_AUDIO_API void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream,
///
/// If set, the stream will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfSoundStream_setLoop(stream, sfFalse) is called.
/// sfSoundStream_setLoop(stream, false) is called.
/// The default looping state for sound streams is false.
///
/// \param soundStream Sound stream object
/// \param loop sfTrue to play in loop, sfFalse to play once
/// \param loop true to play in loop, false to play once
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop);
CSFML_AUDIO_API void sfSoundStream_setLoop(sfSoundStream* soundStream, bool loop);
////////////////////////////////////////////////////////////
/// \brief Get the pitch of a sound stream
@@ -298,10 +298,10 @@ CSFML_AUDIO_API sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundS
///
/// \param soundStream Sound stream object
///
/// \return sfTrue if the position is relative, sfFalse if it's absolute
/// \return true if the position is relative, false if it's absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream);
CSFML_AUDIO_API bool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// \brief Get the minimum distance of a sound stream
@@ -328,10 +328,10 @@ CSFML_AUDIO_API float sfSoundStream_getAttenuation(const sfSoundStream* soundStr
///
/// \param soundStream Sound stream object
///
/// \return sfTrue if the music is looping, sfFalse otherwise
/// \return true if the music is looping, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream);
CSFML_AUDIO_API bool sfSoundStream_getLoop(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// \brief Get the current playing position of a sound stream
+7 -38
View File
@@ -25,6 +25,13 @@
#ifndef SFML_CONFIG_H
#define SFML_CONFIG_H
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <stdint.h>
#include <stdbool.h>
////////////////////////////////////////////////////////////
// Define the CSFML version
@@ -135,42 +142,4 @@
#endif
////////////////////////////////////////////////////////////
// Define a portable boolean type
////////////////////////////////////////////////////////////
typedef int sfBool;
#define sfFalse 0
#define sfTrue 1
////////////////////////////////////////////////////////////
// Define portable fixed-size types
////////////////////////////////////////////////////////////
// All "common" platforms use the same size for char, short and int
// (basically there are 3 types for 3 sizes, so no other match is possible),
// we can use them without doing any kind of check
// 8 bits integer types
typedef signed char sfInt8;
typedef unsigned char sfUint8;
// 16 bits integer types
typedef signed short sfInt16;
typedef unsigned short sfUint16;
// 32 bits integer types
typedef signed int sfInt32;
typedef unsigned int sfUint32;
// 64 bits integer types
#if defined(_MSC_VER)
typedef signed __int64 sfInt64;
typedef unsigned __int64 sfUint64;
#else
typedef signed long long sfInt64;
typedef unsigned long long sfUint64;
#endif
#endif // SFML_CONFIG_H
+1 -1
View File
@@ -235,7 +235,7 @@ CSFML_GRAPHICS_API sfTransform sfCircleShape_getInverseTransform(const sfCircleS
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, bool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a circle shape will display
+8 -8
View File
@@ -37,10 +37,10 @@
////////////////////////////////////////////////////////////
typedef struct
{
sfUint8 r;
sfUint8 g;
sfUint8 b;
sfUint8 a;
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
} sfColor;
@@ -65,7 +65,7 @@ CSFML_GRAPHICS_API sfColor sfTransparent; ///< Transparent (black) predefined co
/// \return sfColor constructed from the components
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue);
CSFML_GRAPHICS_API sfColor sfColor_fromRGB(uint8_t red, uint8_t green, uint8_t blue);
////////////////////////////////////////////////////////////
/// \brief Construct a color from its 4 RGBA components
@@ -78,7 +78,7 @@ CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 b
/// \return sfColor constructed from the components
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
////////////////////////////////////////////////////////////
/// \brief Construct the color from 32-bit unsigned integer
@@ -88,7 +88,7 @@ CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8
/// \return sfColor constructed from the 32-bit unsigned integer
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_fromInteger(sfUint32 color);
CSFML_GRAPHICS_API sfColor sfColor_fromInteger(uint32_t color);
////////////////////////////////////////////////////////////
/// \brief Convert a color to a 32-bit unsigned integer
@@ -96,7 +96,7 @@ CSFML_GRAPHICS_API sfColor sfColor_fromInteger(sfUint32 color);
/// \return Color represented as a 32-bit unsigned integer
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfUint32 sfColor_toInteger(sfColor color);
CSFML_GRAPHICS_API uint32_t sfColor_toInteger(sfColor color);
////////////////////////////////////////////////////////////
/// \brief Add two colors
+1 -1
View File
@@ -235,7 +235,7 @@ CSFML_GRAPHICS_API sfTransform sfConvexShape_getInverseTransform(const sfConvexS
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, bool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a convex shape will display
+7 -7
View File
@@ -97,7 +97,7 @@ CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
/// \return The corresponding glyph
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness);
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness);
////////////////////////////////////////////////////////////
/// \brief Get the kerning value corresponding to a given pair of characters in a font
@@ -110,7 +110,7 @@ CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoin
/// \return Kerning offset, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfFont_getKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
CSFML_GRAPHICS_API float sfFont_getKerning(const sfFont* font, uint32_t first, uint32_t second, unsigned int characterSize);
////////////////////////////////////////////////////////////
/// \brief Get the bold kerning value corresponding to a given pair of characters in a font
@@ -123,7 +123,7 @@ CSFML_GRAPHICS_API float sfFont_getKerning(const sfFont* font, sfUint32 first, s
/// \return Kerning offset, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfFont_getBoldKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
CSFML_GRAPHICS_API float sfFont_getBoldKerning(const sfFont* font, uint32_t first, uint32_t second, unsigned int characterSize);
////////////////////////////////////////////////////////////
/// \brief Get the line spacing value
@@ -184,24 +184,24 @@ CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int
/// The smooth filter is enabled by default.
///
/// \param font Source font
/// \param smooth sfTrue to enable smoothing, sfFalse to disable it
/// \param smooth true to enable smoothing, false to disable it
///
/// \see isSmooth
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfFont_setSmooth(sfFont* font, sfBool smooth);
CSFML_GRAPHICS_API void sfFont_setSmooth(sfFont* font, bool smooth);
////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or disabled
///
/// \param font Source font
///
/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled
/// \return true if smoothing is enabled, false if it is disabled
///
/// \see setSmooth
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfFont_isSmooth(const sfFont* font);
CSFML_GRAPHICS_API bool sfFont_isSmooth(const sfFont* font);
////////////////////////////////////////////////////////////
/// \brief Get the font information
+9 -9
View File
@@ -39,8 +39,8 @@ typedef sfVector2i sfGlslIvec2;
typedef struct
{
sfBool x;
sfBool y;
bool x;
bool y;
} sfGlslBvec2;
// 3D vectors
@@ -55,9 +55,9 @@ typedef struct
typedef struct
{
sfBool x;
sfBool y;
sfBool z;
bool x;
bool y;
bool z;
} sfGlslBvec3;
// 4D vectors
@@ -79,10 +79,10 @@ typedef struct
typedef struct
{
sfBool x;
sfBool y;
sfBool z;
sfBool w;
bool x;
bool y;
bool z;
bool w;
} sfGlslBvec4;
// matrices
+8 -8
View File
@@ -78,7 +78,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_createFromColor(unsigned int width, unsigned
/// \return A new sfImage object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_GRAPHICS_API sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const uint8_t* pixels);
////////////////////////////////////////////////////////////
/// \brief Create an image from a file on disk
@@ -155,12 +155,12 @@ CSFML_GRAPHICS_API void sfImage_destroy(sfImage* image);
/// \param image Image object
/// \param filename Path of the file to save
///
/// \return sfTrue if saving was successful
/// \return true if saving was successful
///
/// \see sfImage_saveToMemory
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfImage_saveToFile(const sfImage* image, const char* filename);
CSFML_GRAPHICS_API bool sfImage_saveToFile(const sfImage* image, const char* filename);
////////////////////////////////////////////////////////////
/// \brief Save the image to a buffer in memory
@@ -174,12 +174,12 @@ CSFML_GRAPHICS_API sfBool sfImage_saveToFile(const sfImage* image, const char* f
/// \param output Buffer to fill with encoded data
/// \param format Encoding format to use
///
/// \return sfTrue if saving was successful
/// \return true if saving was successful
///
/// \see sfImage_saveToFile
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* format);
CSFML_GRAPHICS_API bool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* format);
////////////////////////////////////////////////////////////
/// \brief Return the size of an image
@@ -203,7 +203,7 @@ CSFML_GRAPHICS_API sfVector2u sfImage_getSize(const sfImage* image);
/// \param alpha Alpha value to assign to transparent pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor color, sfUint8 alpha);
CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor color, uint8_t alpha);
////////////////////////////////////////////////////////////
/// \brief Copy pixels from an image onto another
@@ -226,7 +226,7 @@ CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor colo
/// \param applyAlpha Should the copy take in account the source transparency?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha);
CSFML_GRAPHICS_API void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, bool applyAlpha);
////////////////////////////////////////////////////////////
/// \brief Change the color of a pixel in an image
@@ -274,7 +274,7 @@ CSFML_GRAPHICS_API sfColor sfImage_getPixel(const sfImage* image, unsigned int x
/// \return Read-only pointer to the array of pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfUint8* sfImage_getPixelsPtr(const sfImage* image);
CSFML_GRAPHICS_API const uint8_t* sfImage_getPixelsPtr(const sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Flip an image horizontally (left <-> right)
+6 -6
View File
@@ -60,11 +60,11 @@ typedef struct
/// \param x X coordinate of the point to test
/// \param y Y coordinate of the point to test
///
/// \return sfTrue if the point is inside
/// \return true if the point is inside
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfFloatRect_contains(const sfFloatRect* rect, float x, float y);
CSFML_GRAPHICS_API sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y);
CSFML_GRAPHICS_API bool sfFloatRect_contains(const sfFloatRect* rect, float x, float y);
CSFML_GRAPHICS_API bool sfIntRect_contains(const sfIntRect* rect, int x, int y);
////////////////////////////////////////////////////////////
/// \brief Check intersection between two rectangles
@@ -73,11 +73,11 @@ CSFML_GRAPHICS_API sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y
/// \param rect2 Second rectangle to test
/// \param intersection Rectangle to be filled with overlapping rect (can be NULL)
///
/// \return sfTrue if rectangles overlap
/// \return true if rectangles overlap
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
CSFML_GRAPHICS_API sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
CSFML_GRAPHICS_API bool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
CSFML_GRAPHICS_API bool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
////////////////////////////////////////////////////////////
/// \brief Get the position of the rectangle's top-left corner
+1 -1
View File
@@ -235,7 +235,7 @@ CSFML_GRAPHICS_API sfTransform sfRectangleShape_getInverseTransform(const sfRect
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, bool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a rectangle shape will display
+15 -15
View File
@@ -53,7 +53,7 @@
/// Use sfRenderTexture_createWithSettings instead.
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer);
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, bool depthBuffer);
////////////////////////////////////////////////////////////
/// \brief Construct a new render texture
@@ -90,21 +90,21 @@ CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture* ren
///
/// \param renderTexture Render texture object
///
/// \return sfTrue if the render texture use sRGB encoding, sfFalse otherwise
/// \return true if the render texture use sRGB encoding, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSrgb(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API bool sfRenderTexture_isSrgb(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Activate or deactivate a render texture as the current target for rendering
///
/// \param renderTexture Render texture object
/// \param active sfTrue to activate, sfFalse to deactivate
/// \param active true to activate, false to deactivate
///
/// \return True if operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active);
CSFML_GRAPHICS_API bool sfRenderTexture_setActive(sfRenderTexture* renderTexture, bool active);
////////////////////////////////////////////////////////////
/// \brief Update the contents of the target texture
@@ -332,39 +332,39 @@ CSFML_GRAPHICS_API unsigned int sfRenderTexture_getMaximumAntialiasingLevel(void
/// \brief Enable or disable the smooth filter on a render texture
///
/// \param renderTexture Render texture object
/// \param smooth sfTrue to enable smoothing, sfFalse to disable it
/// \param smooth true to enable smoothing, false to disable it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth);
CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, bool smooth);
////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not for a render texture
///
/// \param renderTexture Render texture object
///
/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled
/// \return true if smoothing is enabled, false if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API bool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Enable or disable texture repeating
///
/// \param renderTexture Render texture object
/// \param repeated sfTrue to enable repeating, sfFalse to disable it
/// \param repeated true to enable repeating, false to disable it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated);
CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, bool repeated);
////////////////////////////////////////////////////////////
/// \brief Tell whether the texture is repeated or not
///
/// \param renderTexture Render texture object
///
/// \return sfTrue if repeat mode is enabled, sfFalse if it is disabled
/// \return true if repeat mode is enabled, false if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API bool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Generate a mipmap using the current texture data
@@ -377,10 +377,10 @@ CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* rend
/// after subsequent drawing will lead to undefined behavior if a mipmap
/// had been previously generated.
///
/// \return sfTrue if mipmap generation was successful, sfFalse if unsuccessful
/// \return true if mipmap generation was successful, false if unsuccessful
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API bool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture);
#endif // SFML_RENDERTEXTURE_H
+24 -24
View File
@@ -52,7 +52,7 @@
/// \param settings Creation settings (pass NULL to use default values)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, uint32_t style, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a new render window (with a UTF-32 title)
@@ -63,7 +63,7 @@ CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const
/// \param settings Creation settings (pass NULL to use default values)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const uint32_t* title, uint32_t style, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a render window from an existing control
@@ -96,7 +96,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow* renderWindow);
/// \param renderWindow Render window object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API bool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Get the creation settings of a render window
@@ -114,10 +114,10 @@ CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWi
/// \param renderWindow Render window object
/// \param event Event to fill, if any
///
/// \return sfTrue if an event was returned, sfFalse if event queue was empty
/// \return true if an event was returned, false if event queue was empty
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
CSFML_GRAPHICS_API bool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Wait for an event and return it
@@ -125,10 +125,10 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow,
/// \param renderWindow Render window object
/// \param event Event to fill
///
/// \return sfFalse if an error occured
/// \return false if an error occured
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
CSFML_GRAPHICS_API bool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Get the position of a render window
@@ -166,10 +166,10 @@ CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow* rende
///
/// \param renderWindow Render window object
///
/// \return sfTrue if the render window use sRGB encoding, sfFalse otherwise
/// \return true if the render window use sRGB encoding, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_isSrgb(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API bool sfRenderWindow_isSrgb(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Change the size of the rendering region of a render window
@@ -196,7 +196,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, co
/// \param title New title
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title);
CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const uint32_t* title);
////////////////////////////////////////////////////////////
/// \brief Change a render window's icon
@@ -207,34 +207,34 @@ CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWin
/// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const uint8_t* pixels);
////////////////////////////////////////////////////////////
/// \brief Show or hide a render window
///
/// \param renderWindow Render window object
/// \param visible sfTrue to show the window, sfFalse to hide it
/// \param visible true to show the window, false to hide it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, bool visible);
////////////////////////////////////////////////////////////
/// \brief Enable / disable vertical synchronization on a render window
///
/// \param renderWindow Render window object
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
/// \param enabled true to enable v-sync, false to deactivate
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Show or hide the mouse cursor on a render window
///
/// \param renderWindow Render window object
/// \param show sfTrue to show, sfFalse to hide
/// \param show true to show, false to hide
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, bool show);
////////////////////////////////////////////////////////////
/// \brief Grab or release the mouse cursor
@@ -246,10 +246,10 @@ CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* ren
/// won't have any effect (fullscreen windows always grab the
/// cursor).
///
/// \param grabbed sfTrue to enable, sfFalse to disable
/// \param grabbed true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed);
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, bool grabbed);
////////////////////////////////////////////////////////////
/// \brief Set the displayed cursor to a native system cursor
@@ -276,10 +276,10 @@ CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursor(sfRenderWindow* window, co
/// Automatic key-repeat is enabled by default
///
/// \param renderWindow Render window object
/// \param enabled sfTrue to enable, sfFalse to disable
/// \param enabled true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Limit the framerate to a maximum fixed frequency for a render window
@@ -303,12 +303,12 @@ CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* rend
/// \brief Activate or deactivate a render window as the current target for rendering
///
/// \param renderWindow Render window object
/// \param active sfTrue to activate, sfFalse to deactivate
/// \param active true to activate, false to deactivate
///
/// \return True if operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
CSFML_GRAPHICS_API bool sfRenderWindow_setActive(sfRenderWindow* renderWindow, bool active);
///////////////////////////////////////////////////////////
/// \brief Request the current render window to be made the active
@@ -334,7 +334,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_requestFocus(sfRenderWindow* renderWindow
/// \return True if window has focus, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API bool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Display a render window on screen
+4 -4
View File
@@ -221,7 +221,7 @@ CSFML_GRAPHICS_API void sfShader_setIntColorUniform(sfShader* shader, const char
/// \param x Value of the bool scalar
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_setBoolUniform(sfShader* shader, const char* name, sfBool x);
CSFML_GRAPHICS_API void sfShader_setBoolUniform(sfShader* shader, const char* name, bool x);
////////////////////////////////////////////////////////////
/// \brief Specify value for \p bvec2 uniform
@@ -689,10 +689,10 @@ CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
/// the shader features. If it returns false, then
/// any attempt to use sfShader will fail.
///
/// \return sfTrue if the system can use shaders, sfFalse otherwise
/// \return true if the system can use shaders, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
CSFML_GRAPHICS_API bool sfShader_isAvailable(void);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not the system supports geometry shaders
@@ -711,6 +711,6 @@ CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
/// \return True if geometry shaders are supported, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfShader_isGeometryAvailable(void);
CSFML_GRAPHICS_API bool sfShader_isGeometryAvailable(void);
#endif // SFML_SHADER_H
+1 -1
View File
@@ -234,7 +234,7 @@ CSFML_GRAPHICS_API sfTransform sfShape_getInverseTransform(const sfShape* shape)
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_setTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfShape_setTexture(sfShape* shape, const sfTexture* texture, bool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a shape will display
+1 -1
View File
@@ -234,7 +234,7 @@ CSFML_GRAPHICS_API sfTransform sfSprite_getInverseTransform(const sfSprite* spri
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, bool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a sprite will display
+4 -4
View File
@@ -247,7 +247,7 @@ CSFML_GRAPHICS_API void sfText_setString(sfText* text, const char* string);
/// \param string New string
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const sfUint32* string);
CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const uint32_t* string);
////////////////////////////////////////////////////////////
/// \brief Set the font of a text
@@ -322,7 +322,7 @@ CSFML_GRAPHICS_API void sfText_setLetterSpacing(sfText* text, float spacingFacto
/// \param style New style
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, uint32_t style);
////////////////////////////////////////////////////////////
/// \brief Set the fill color of a text
@@ -397,7 +397,7 @@ CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
/// \return String as UTF-32
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString(const sfText* text);
CSFML_GRAPHICS_API const uint32_t* sfText_getUnicodeString(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the font used by a text
@@ -455,7 +455,7 @@ CSFML_GRAPHICS_API float sfText_getLineSpacing(const sfText* text);
/// \return Current string style (see sfTextStyle enum)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text);
CSFML_GRAPHICS_API uint32_t sfText_getStyle(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the fill color of a text
+11 -11
View File
@@ -208,7 +208,7 @@ CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture);
/// \param y Y offset in the texture where to copy the source pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const uint8_t* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
////////////////////////////////////////////////////////////
/// \brief Update a part of this texture from another texture
@@ -265,20 +265,20 @@ CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, con
/// \brief Enable or disable the smooth filter on a texture
///
/// \param texture The texture object
/// \param smooth sfTrue to enable smoothing, sfFalse to disable it
/// \param smooth true to enable smoothing, false to disable it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, bool smooth);
////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not for a texture
///
/// \param texture The texture object
///
/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled
/// \return true if smoothing is enabled, false if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
CSFML_GRAPHICS_API bool sfTexture_isSmooth(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Tell whether the texture source is converted from sRGB or not
@@ -291,7 +291,7 @@ CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
/// \see sfTexture_createSrgbFromImage
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture* texture);
CSFML_GRAPHICS_API bool sfTexture_isSrgb(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Enable or disable repeating for a texture
@@ -314,17 +314,17 @@ CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture* texture);
/// \param repeated True to repeat the texture, false to disable repeating
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeated);
CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, bool repeated);
////////////////////////////////////////////////////////////
/// \brief Tell whether a texture is repeated or not
///
/// \param texture The texture object
///
/// \return sfTrue if repeat mode is enabled, sfFalse if it is disabled
/// \return true if repeat mode is enabled, false if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
CSFML_GRAPHICS_API bool sfTexture_isRepeated(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Generate a mipmap using the current texture data
@@ -346,10 +346,10 @@ CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
/// modified, at which point this function will have to be called again to
/// regenerate it.
///
/// \return sfTrue if mipmap generation was successful, sfFalse if unsuccessful
/// \return true if mipmap generation was successful, false if unsuccessful
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture* texture);
CSFML_GRAPHICS_API bool sfTexture_generateMipmap(sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Swap the contents of a texture with those of another
+1 -1
View File
@@ -218,6 +218,6 @@ CSFML_GRAPHICS_API void sfTransform_scaleWithCenter(sfTransform* transform, floa
/// \return true if the transforms are equal, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTransform_equal(sfTransform* left, sfTransform* right);
CSFML_GRAPHICS_API bool sfTransform_equal(sfTransform* left, sfTransform* right);
#endif // SFML_TRANSFORM_H
+5 -5
View File
@@ -126,10 +126,10 @@ CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuff
/// \param vertexCount Number of vertices to copy
/// \param offset Offset in the buffer to copy to
///
/// \return sfTrue if the update was successful
/// \return true if the update was successful
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset);
CSFML_GRAPHICS_API bool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset);
////////////////////////////////////////////////////////////
/// \brief Copy the contents of another buffer into this buffer
@@ -137,10 +137,10 @@ CSFML_GRAPHICS_API sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, co
/// \param vertexBuffer Vertex buffer object
/// \param other Vertex buffer whose contents to copy into first vertex buffer
///
/// \return sfTrue if the copy was successful
/// \return true if the copy was successful
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other);
CSFML_GRAPHICS_API bool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other);
////////////////////////////////////////////////////////////
/// \brief Swap the contents of this vertex buffer with those of another
@@ -248,7 +248,7 @@ CSFML_GRAPHICS_API void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer);
/// \return True if vertex buffers are supported, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfVertexBuffer_isAvailable(void);
CSFML_GRAPHICS_API bool sfVertexBuffer_isAvailable(void);
#endif // SFML_VERTEXBUFFER_H
+8 -8
View File
@@ -129,10 +129,10 @@ CSFML_NETWORK_API void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpLis
///
/// \param ftpListingResponse Ftp listing response
///
/// \return sfTrue if the status is a success, sfFalse if it is a failure
/// \return true if the status is a success, false if it is a failure
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API bool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a FTP listing response
@@ -191,10 +191,10 @@ CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ft
///
/// \param ftpDirectoryResponse Ftp directory response
///
/// \return sfTrue if the status is a success, sfFalse if it is a failure
/// \return true if the status is a success, false if it is a failure
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API bool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a FTP directory response
@@ -243,10 +243,10 @@ CSFML_NETWORK_API void sfFtpResponse_destroy(sfFtpResponse* ftpResponse);
///
/// \param ftpResponse Ftp response object
///
/// \return sfTrue if the status is a success, sfFalse if it is a failure
/// \return true if the status is a success, false if it is a failure
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse);
CSFML_NETWORK_API bool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a FTP response
@@ -500,12 +500,12 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFi
/// \param localFile Path of the local file to upload
/// \param remotePath Where to put to file on the server
/// \param mode Transfer mode
/// \param append Pass sfTrue to append to or sfFalse to overwrite the remote file if it already exists
/// \param append Pass true to append to or false to overwrite the remote file if it already exists
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, sfBool append);
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, bool append);
////////////////////////////////////////////////////////////
/// \brief Send a command to the FTP server
+3 -3
View File
@@ -95,7 +95,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_fromString(const char* address);
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3);
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes(uint8_t byte0, uint8_t byte1, uint8_t byte2, uint8_t byte3);
////////////////////////////////////////////////////////////
/// \brief Construct an address from a 32-bits integer
@@ -110,7 +110,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address);
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(uint32_t address);
////////////////////////////////////////////////////////////
/// \brief Get a string representation of an address
@@ -139,7 +139,7 @@ CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string);
/// \return 32-bits unsigned integer representation of the address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfUint32 sfIpAddress_toInteger(sfIpAddress address);
CSFML_NETWORK_API uint32_t sfIpAddress_toInteger(sfIpAddress address);
////////////////////////////////////////////////////////////
/// \brief Get the computer's local address
+18 -18
View File
@@ -128,10 +128,10 @@ CSFML_NETWORK_API size_t sfPacket_getDataSize(const sfPacket* packet);
///
/// \param packet Packet object
///
/// \return sfTrue if all data was read, sfFalse otherwise
/// \return true if all data was read, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfPacket_endOfPacket(const sfPacket* packet);
CSFML_NETWORK_API bool sfPacket_endOfPacket(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Test the validity of a packet, for reading
@@ -144,10 +144,10 @@ CSFML_NETWORK_API sfBool sfPacket_endOfPacket(const sfPacket* packet);
///
/// \param packet Packet object
///
/// \return sfTrue if last data extraction from packet was successful
/// \return true if last data extraction from packet was successful
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfPacket_canRead(const sfPacket* packet);
CSFML_NETWORK_API bool sfPacket_canRead(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Functions to extract data from a packet
@@ -155,13 +155,13 @@ CSFML_NETWORK_API sfBool sfPacket_canRead(const sfPacket* packet);
/// \param packet Packet object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfPacket_readBool(sfPacket* packet);
CSFML_NETWORK_API sfInt8 sfPacket_readInt8(sfPacket* packet);
CSFML_NETWORK_API sfUint8 sfPacket_readUint8(sfPacket* packet);
CSFML_NETWORK_API sfInt16 sfPacket_readInt16(sfPacket* packet);
CSFML_NETWORK_API sfUint16 sfPacket_readUint16(sfPacket* packet);
CSFML_NETWORK_API sfInt32 sfPacket_readInt32(sfPacket* packet);
CSFML_NETWORK_API sfUint32 sfPacket_readUint32(sfPacket* packet);
CSFML_NETWORK_API bool sfPacket_readBool(sfPacket* packet);
CSFML_NETWORK_API int8_t sfPacket_readInt8(sfPacket* packet);
CSFML_NETWORK_API uint8_t sfPacket_readUint8(sfPacket* packet);
CSFML_NETWORK_API int16_t sfPacket_readInt16(sfPacket* packet);
CSFML_NETWORK_API uint16_t sfPacket_readUint16(sfPacket* packet);
CSFML_NETWORK_API int32_t sfPacket_readInt32(sfPacket* packet);
CSFML_NETWORK_API uint32_t sfPacket_readUint32(sfPacket* packet);
CSFML_NETWORK_API float sfPacket_readFloat(sfPacket* packet);
CSFML_NETWORK_API double sfPacket_readDouble(sfPacket* packet);
CSFML_NETWORK_API void sfPacket_readString(sfPacket* packet, char* string);
@@ -173,13 +173,13 @@ CSFML_NETWORK_API void sfPacket_readWideString(sfPacket* packet, wchar_t* st
/// \param packet Packet object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfPacket_writeBool(sfPacket* packet, sfBool);
CSFML_NETWORK_API void sfPacket_writeInt8(sfPacket* packet, sfInt8);
CSFML_NETWORK_API void sfPacket_writeUint8(sfPacket* packet, sfUint8);
CSFML_NETWORK_API void sfPacket_writeInt16(sfPacket* packet, sfInt16);
CSFML_NETWORK_API void sfPacket_writeUint16(sfPacket* packet, sfUint16);
CSFML_NETWORK_API void sfPacket_writeInt32(sfPacket* packet, sfInt32);
CSFML_NETWORK_API void sfPacket_writeUint32(sfPacket* packet, sfUint32);
CSFML_NETWORK_API void sfPacket_writeBool(sfPacket* packet, bool);
CSFML_NETWORK_API void sfPacket_writeInt8(sfPacket* packet, int8_t);
CSFML_NETWORK_API void sfPacket_writeUint8(sfPacket* packet, uint8_t);
CSFML_NETWORK_API void sfPacket_writeInt16(sfPacket* packet, int16_t);
CSFML_NETWORK_API void sfPacket_writeUint16(sfPacket* packet, uint16_t);
CSFML_NETWORK_API void sfPacket_writeInt32(sfPacket* packet, int32_t);
CSFML_NETWORK_API void sfPacket_writeUint32(sfPacket* packet, uint32_t);
CSFML_NETWORK_API void sfPacket_writeFloat(sfPacket* packet, float);
CSFML_NETWORK_API void sfPacket_writeDouble(sfPacket* packet, double);
CSFML_NETWORK_API void sfPacket_writeString(sfPacket* packet, const char* string);
+8 -8
View File
@@ -107,15 +107,15 @@ CSFML_NETWORK_API void sfSocketSelector_clear(sfSocketSelector* selector);
/// some data available to be received. To know which sockets are
/// ready, use the sfSocketSelector_isXxxReady functions.
/// If you use a timeout and no socket is ready before the timeout
/// is over, the function returns sfFalse.
/// is over, the function returns false.
///
/// \param selector Socket selector object
/// \param timeout Maximum time to wait (use sfTimeZero for infinity)
///
/// \return sfTrue if there are sockets ready, sfFalse otherwise
/// \return true if there are sockets ready, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout);
CSFML_NETWORK_API bool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout);
////////////////////////////////////////////////////////////
/// \brief Test a socket to know if it is ready to receive data
@@ -124,18 +124,18 @@ CSFML_NETWORK_API sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTim
/// sfSocketSelector_wait, to know which sockets are ready to
/// receive data. If a socket is ready, a call to Receive will
/// never block because we know that there is data available to read.
/// Note that if this function returns sfTrue for a sfTcpListener,
/// Note that if this function returns true for a sfTcpListener,
/// this means that it is ready to accept a new connection.
///
/// \param selector Socket selector object
/// \param socket Socket to test
///
/// \return sfTrue if the socket is ready to read, sfFalse otherwise
/// \return true if the socket is ready to read, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket);
CSFML_NETWORK_API bool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API bool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API bool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket);
#endif // SFML_SOCKETSELECTOR_H
+4 -4
View File
@@ -63,20 +63,20 @@ CSFML_NETWORK_API void sfTcpListener_destroy(sfTcpListener* listener);
/// By default, all sockets are blocking.
///
/// \param listener TCP listener object
/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking
/// \param blocking true to set the socket as blocking, false for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking);
CSFML_NETWORK_API void sfTcpListener_setBlocking(sfTcpListener* listener, bool blocking);
////////////////////////////////////////////////////////////
/// \brief Tell whether a TCP listener is in blocking or non-blocking mode
///
/// \param listener TCP listener object
///
/// \return sfTrue if the socket is blocking, sfFalse otherwise
/// \return true if the socket is blocking, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfTcpListener_isBlocking(const sfTcpListener* listener);
CSFML_NETWORK_API bool sfTcpListener_isBlocking(const sfTcpListener* listener);
////////////////////////////////////////////////////////////
/// \brief Get the port to which a TCP listener is bound locally
+4 -4
View File
@@ -65,20 +65,20 @@ CSFML_NETWORK_API void sfTcpSocket_destroy(sfTcpSocket* socket);
/// By default, all sockets are blocking.
///
/// \param socket TCP socket object
/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking
/// \param blocking true to set the socket as blocking, false for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking);
CSFML_NETWORK_API void sfTcpSocket_setBlocking(sfTcpSocket* socket, bool blocking);
////////////////////////////////////////////////////////////
/// \brief Tell whether a TCP socket is in blocking or non-blocking mode
///
/// \param socket TCP socket object
///
/// \return sfTrue if the socket is blocking, sfFalse otherwise
/// \return true if the socket is blocking, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket);
CSFML_NETWORK_API bool sfTcpSocket_isBlocking(const sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Get the port to which a TCP socket is bound locally
+4 -4
View File
@@ -64,20 +64,20 @@ CSFML_NETWORK_API void sfUdpSocket_destroy(sfUdpSocket* socket);
/// By default, all sockets are blocking.
///
/// \param socket UDP socket object
/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking
/// \param blocking true to set the socket as blocking, false for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking);
CSFML_NETWORK_API void sfUdpSocket_setBlocking(sfUdpSocket* socket, bool blocking);
////////////////////////////////////////////////////////////
/// \brief Tell whether a UDP socket is in blocking or non-blocking mode
///
/// \param socket UDP socket object
///
/// \return sfTrue if the socket is blocking, sfFalse otherwise
/// \return true if the socket is blocking, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket);
CSFML_NETWORK_API bool sfUdpSocket_isBlocking(const sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Get the port to which a UDP socket is bound locally
+1 -1
View File
@@ -67,7 +67,7 @@ CSFML_SYSTEM_API size_t sfBuffer_getSize(const sfBuffer* buffer);
/// \return Read-only pointer to the array of bytes
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API const sfUint8* sfBuffer_getData(const sfBuffer* buffer);
CSFML_SYSTEM_API const uint8_t* sfBuffer_getData(const sfBuffer* buffer);
#endif // SFML_BUFFER_H
+4 -4
View File
@@ -31,10 +31,10 @@
#include <SFML/System/Export.h>
typedef sfInt64 (*sfInputStreamReadFunc)(void* data, sfInt64 size, void* userData);
typedef sfInt64 (*sfInputStreamSeekFunc)(sfInt64 position, void* userData);
typedef sfInt64 (*sfInputStreamTellFunc)(void* userData);
typedef sfInt64 (*sfInputStreamGetSizeFunc)(void* userData);
typedef int64_t (*sfInputStreamReadFunc)(void* data, int64_t size, void* userData);
typedef int64_t (*sfInputStreamSeekFunc)(int64_t position, void* userData);
typedef int64_t (*sfInputStreamTellFunc)(void* userData);
typedef int64_t (*sfInputStreamGetSizeFunc)(void* userData);
////////////////////////////////////////////////////////////
+5 -5
View File
@@ -37,7 +37,7 @@
////////////////////////////////////////////////////////////
typedef struct
{
sfInt64 microseconds;
int64_t microseconds;
} sfTime;
////////////////////////////////////////////////////////////
@@ -64,7 +64,7 @@ CSFML_SYSTEM_API float sfTime_asSeconds(sfTime time);
/// \return Time in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfInt32 sfTime_asMilliseconds(sfTime time);
CSFML_SYSTEM_API int32_t sfTime_asMilliseconds(sfTime time);
////////////////////////////////////////////////////////////
/// \brief Return a time value as a number of microseconds
@@ -74,7 +74,7 @@ CSFML_SYSTEM_API sfInt32 sfTime_asMilliseconds(sfTime time);
/// \return Time in microseconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfInt64 sfTime_asMicroseconds(sfTime time);
CSFML_SYSTEM_API int64_t sfTime_asMicroseconds(sfTime time);
////////////////////////////////////////////////////////////
/// \brief Construct a time value from a number of seconds
@@ -94,7 +94,7 @@ CSFML_SYSTEM_API sfTime sfSeconds(float amount);
/// \return Time value constructed from the amount of milliseconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfTime sfMilliseconds(sfInt32 amount);
CSFML_SYSTEM_API sfTime sfMilliseconds(int32_t amount);
////////////////////////////////////////////////////////////
/// \brief Construct a time value from a number of microseconds
@@ -104,7 +104,7 @@ CSFML_SYSTEM_API sfTime sfMilliseconds(sfInt32 amount);
/// \return Time value constructed from the amount of microseconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfTime sfMicroseconds(sfInt64 amount);
CSFML_SYSTEM_API sfTime sfMicroseconds(int64_t amount);
#endif // SFML_TIME_H
+2 -2
View File
@@ -55,7 +55,7 @@ CSFML_WINDOW_API const char* sfClipboard_getString(void);
/// \return Clipboard contents as UTF-32
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API const sfUint32* sfClipboard_getUnicodeString(void);
CSFML_WINDOW_API const uint32_t* sfClipboard_getUnicodeString(void);
////////////////////////////////////////////////////////////
/// \brief Set the content of the clipboard as ANSI string data
@@ -79,7 +79,7 @@ CSFML_WINDOW_API void sfClipboard_setString(const char* text);
/// to the clipboard
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfClipboard_setUnicodeString(const sfUint32* text);
CSFML_WINDOW_API void sfClipboard_setUnicodeString(const uint32_t* text);
#endif // SFML_CURSOR_H
+5 -5
View File
@@ -60,18 +60,18 @@ CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
/// \return True if available, false if unavailable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfContext_isExtensionAvailable(const char* name);
CSFML_WINDOW_API bool sfContext_isExtensionAvailable(const char* name);
////////////////////////////////////////////////////////////
/// \brief Activate or deactivate explicitely a context
///
/// \param context Context object
/// \param active sfTrue to activate, sfFalse to deactivate
/// \param active true to activate, false to deactivate
///
/// \return sfTrue on success, sfFalse on failure
/// \return true on success, false on failure
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfContext_setActive(sfContext* context, sfBool active);
CSFML_WINDOW_API bool sfContext_setActive(sfContext* context, bool active);
////////////////////////////////////////////////////////////
/// \brief Get the address of an OpenGL function.
@@ -106,6 +106,6 @@ CSFML_WINDOW_API sfContextSettings sfContext_getSettings(const sfContext* contex
/// \return The active context's ID or 0 if no context is currently active
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfUint64 sfContext_getActiveContextId(void);
CSFML_WINDOW_API uint64_t sfContext_getActiveContextId(void);
#endif // SFML_CONTEXT_H
+1 -1
View File
@@ -118,7 +118,7 @@ typedef enum
/// \return A new sfCursor object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfCursor* sfCursor_createFromPixels(const sfUint8* pixels, sfVector2u size, sfVector2u hotspot);
CSFML_WINDOW_API sfCursor* sfCursor_createFromPixels(const uint8_t* pixels, sfVector2u size, sfVector2u hotspot);
////////////////////////////////////////////////////////////
+5 -5
View File
@@ -78,10 +78,10 @@ typedef struct
sfEventType type;
sfKeyCode code;
sfScancode scancode;
sfBool alt;
sfBool control;
sfBool shift;
sfBool system;
bool alt;
bool control;
bool shift;
bool system;
} sfKeyEvent;
////////////////////////////////////////////////////////////
@@ -91,7 +91,7 @@ typedef struct
typedef struct
{
sfEventType type;
sfUint32 unicode;
uint32_t unicode;
} sfTextEvent;
////////////////////////////////////////////////////////////
+6 -6
View File
@@ -66,10 +66,10 @@ typedef enum
///
/// \param joystick Index of the joystick to check
///
/// \return sfTrue if the joystick is connected, sfFalse otherwise
/// \return true if the joystick is connected, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfJoystick_isConnected(unsigned int joystick);
CSFML_WINDOW_API bool sfJoystick_isConnected(unsigned int joystick);
////////////////////////////////////////////////////////////
/// \brief Return the number of buttons supported by a joystick
@@ -91,10 +91,10 @@ CSFML_WINDOW_API unsigned int sfJoystick_getButtonCount(unsigned int joystick);
/// \param joystick Index of the joystick
/// \param axis Axis to check
///
/// \return sfTrue if the joystick supports the axis, sfFalse otherwise
/// \return true if the joystick supports the axis, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis);
CSFML_WINDOW_API bool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis);
////////////////////////////////////////////////////////////
/// \brief Check if a joystick button is pressed
@@ -104,10 +104,10 @@ CSFML_WINDOW_API sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis
/// \param joystick Index of the joystick
/// \param button Button to check
///
/// \return sfTrue if the button is pressed, sfFalse otherwise
/// \return true if the button is pressed, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button);
CSFML_WINDOW_API bool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button);
////////////////////////////////////////////////////////////
/// \brief Get the current position of a joystick axis
+5 -5
View File
@@ -331,24 +331,24 @@ typedef enum
///
/// \param key Key to check
///
/// \return sfTrue if the key is pressed, sfFalse otherwise
/// \return true if the key is pressed, false otherwise
///
/// \see sfKeyboard_isScancodePressed
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
CSFML_WINDOW_API bool sfKeyboard_isKeyPressed(sfKeyCode key);
////////////////////////////////////////////////////////////
/// \brief Check if a key is pressed
///
/// \param code Scancode to check
///
/// \return sfTrue if the physical key is pressed, sfFalse otherwise
/// \return true if the physical key is pressed, false otherwise
///
/// \see sfKeyboard_isKeyPressed
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfKeyboard_isScancodePressed(sfScancode code);
CSFML_WINDOW_API bool sfKeyboard_isScancodePressed(sfScancode code);
////////////////////////////////////////////////////////////
/// \brief Localize a physical key to a logical one
@@ -418,6 +418,6 @@ CSFML_WINDOW_API const char* sfKeyboard_getDescription(sfScancode code);
/// \param visible True to show, false to hide
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(sfBool visible);
CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(bool visible);
#endif // SFML_KEYBOARD_H
+2 -2
View File
@@ -64,10 +64,10 @@ typedef enum
///
/// \param button Button to check
///
/// \return sfTrue if the button is pressed, sfFalse otherwise
/// \return true if the button is pressed, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfMouse_isButtonPressed(sfMouseButton button);
CSFML_WINDOW_API bool sfMouse_isButtonPressed(sfMouseButton button);
////////////////////////////////////////////////////////////
/// \brief Get the current position of the mouse
+4 -4
View File
@@ -55,10 +55,10 @@ typedef enum
///
/// \param sensor Sensor to check
///
/// \return sfTrue if the sensor is available, sfFalse otherwise
/// \return true if the sensor is available, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfSensor_isAvailable(sfSensorType sensor);
CSFML_WINDOW_API bool sfSensor_isAvailable(sfSensorType sensor);
////////////////////////////////////////////////////////////
/// \brief Enable or disable a sensor
@@ -70,10 +70,10 @@ CSFML_WINDOW_API sfBool sfSensor_isAvailable(sfSensorType sensor);
/// This function does nothing if the sensor is unavailable.
///
/// \param sensor Sensor to enable
/// \param enabled sfTrue to enable, sfFalse to disable
/// \param enabled true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfSensor_setEnabled(sfSensorType sensor, sfBool enabled);
CSFML_WINDOW_API void sfSensor_setEnabled(sfSensorType sensor, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Get the current sensor value
+2 -2
View File
@@ -38,10 +38,10 @@
///
/// \param finger Finger index
///
/// \return sfTrue if \a finger is currently touching the screen, sfFalse otherwise
/// \return true if \a finger is currently touching the screen, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfTouch_isDown(unsigned int finger);
CSFML_WINDOW_API bool sfTouch_isDown(unsigned int finger);
////////////////////////////////////////////////////////////
/// \brief Get the current position of a touch in window coordinates
+2 -2
View File
@@ -81,10 +81,10 @@ CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count
///
/// \param mode Video mode
///
/// \return sfTrue if the video mode is valid for fullscreen mode
/// \return true if the video mode is valid for fullscreen mode
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfVideoMode_isValid(sfVideoMode mode);
CSFML_WINDOW_API bool sfVideoMode_isValid(sfVideoMode mode);
#endif // SFML_VIDEOMODE_H
+2 -2
View File
@@ -37,7 +37,7 @@ typedef struct VkSurfaceKHR_T* VkSurfaceKHR;
#else
typedef sfUint64 VkSurfaceKHR;
typedef uint64_t VkSurfaceKHR;
#endif
@@ -62,7 +62,7 @@ typedef void (*sfVulkanFunctionPointer)(void);
/// \return True if Vulkan is supported, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfVulkan_isAvailable(sfBool requireGraphics);
CSFML_WINDOW_API bool sfVulkan_isAvailable(bool requireGraphics);
////////////////////////////////////////////////////////////
/// \brief Get the address of a Vulkan function
+28 -28
View File
@@ -60,8 +60,8 @@ typedef struct
unsigned int antialiasingLevel; ///< Level of antialiasing
unsigned int majorVersion; ///< Major number of the context version to create
unsigned int minorVersion; ///< Minor number of the context version to create
sfUint32 attributeFlags; ///< The attribute flags to create the context with
sfBool sRgbCapable; ///< Whether the context framebuffer is sRGB capable
uint32_t attributeFlags; ///< The attribute flags to create the context with
bool sRgbCapable; ///< Whether the context framebuffer is sRGB capable
} sfContextSettings;
@@ -86,7 +86,7 @@ typedef struct
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, uint32_t style, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a new window (with a UTF-32 title)
@@ -109,7 +109,7 @@ CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title,
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const uint32_t* title, uint32_t style, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a window from an existing control
@@ -155,15 +155,15 @@ CSFML_WINDOW_API void sfWindow_close(sfWindow* window);
/// \brief Tell whether or not a window is opened
///
/// This function returns whether or not the window exists.
/// Note that a hidden window (sfWindow_setVisible(sfFalse)) will return
/// sfTrue.
/// Note that a hidden window (sfWindow_setVisible(false)) will return
/// true.
///
/// \param window Window object
///
/// \return sfTrue if the window is opened, sfFalse if it has been closed
/// \return true if the window is opened, false if it has been closed
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_isOpen(const sfWindow* window);
CSFML_WINDOW_API bool sfWindow_isOpen(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Get the settings of the OpenGL context of a window
@@ -192,10 +192,10 @@ CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window);
/// \param window Window object
/// \param event Event to be returned
///
/// \return sfTrue if an event was returned, or sfFalse if the event queue was empty
/// \return true if an event was returned, or false if the event queue was empty
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
CSFML_WINDOW_API bool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Wait for an event and return it
@@ -211,10 +211,10 @@ CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
/// \param window Window object
/// \param event Event to be returned
///
/// \return sfFalse if any error occured
/// \return false if any error occured
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event);
CSFML_WINDOW_API bool sfWindow_waitEvent(sfWindow* window, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Get the position of a window
@@ -277,7 +277,7 @@ CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title);
/// \param title New title
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32* title);
CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const uint32_t* title);
////////////////////////////////////////////////////////////
/// \brief Change a window's icon
@@ -291,16 +291,16 @@ CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32*
/// \param pixels Pointer to the array of pixels in memory
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const uint8_t* pixels);
////////////////////////////////////////////////////////////
/// \brief Show or hide a window
///
/// \param window Window object
/// \param visible sfTrue to show the window, sfFalse to hide it
/// \param visible true to show the window, false to hide it
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, bool visible);
////////////////////////////////////////////////////////////
/// \brief Enable or disable vertical synchronization
@@ -311,19 +311,19 @@ CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
/// to a good value (but not constant across different computers).
///
/// \param window Window object
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
/// \param enabled true to enable v-sync, false to deactivate
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Show or hide the mouse cursor
///
/// \param window Window object
/// \param visible sfTrue to show, sfFalse to hide
/// \param visible true to show, false to hide
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, bool visible);
////////////////////////////////////////////////////////////
/// \brief Grab or release the mouse cursor
@@ -335,10 +335,10 @@ CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool vi
/// won't have any effect (fullscreen windows always grab the
/// cursor).
///
/// \param grabbed sfTrue to enable, sfFalse to disable
/// \param grabbed true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed);
CSFML_WINDOW_API void sfWindow_setMouseCursorGrabbed(sfWindow* window, bool grabbed);
////////////////////////////////////////////////////////////
/// \brief Set the displayed cursor to a native system cursor
@@ -370,10 +370,10 @@ CSFML_WINDOW_API void sfWindow_setMouseCursor(sfWindow* window, const sfCursor*
/// Key repeat is enabled by default.
///
/// \param window Window object
/// \param enabled sfTrue to enable, sfFalse to disable
/// \param enabled true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Limit the framerate to a maximum fixed frequency
@@ -412,12 +412,12 @@ CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float thre
/// This is not to be confused with sfWindow_requestFocus().
///
/// \param window Window object
/// \param active sfTrue to activate, sfFalse to deactivate
/// \param active true to activate, false to deactivate
///
/// \return sfTrue if operation was successful, sfFalse otherwise
/// \return true if operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
CSFML_WINDOW_API bool sfWindow_setActive(sfWindow* window, bool active);
////////////////////////////////////////////////////////////
/// \brief Request the current window to be made the active
@@ -443,7 +443,7 @@ CSFML_WINDOW_API void sfWindow_requestFocus(sfWindow* window);
/// \return True if window has focus, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_hasFocus(const sfWindow* window);
CSFML_WINDOW_API bool sfWindow_hasFocus(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Display on screen what has been rendered to the
+22 -22
View File
@@ -68,7 +68,7 @@ typedef enum
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, sfUint32 style);
CSFML_WINDOW_API sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, uint32_t style);
////////////////////////////////////////////////////////////
/// \brief Construct a new window (with a UTF-32 title)
@@ -86,7 +86,7 @@ CSFML_WINDOW_API sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char*
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindowBase* sfWindowBase_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style);
CSFML_WINDOW_API sfWindowBase* sfWindowBase_createUnicode(sfVideoMode mode, const uint32_t* title, uint32_t style);
////////////////////////////////////////////////////////////
/// \brief Construct a window from an existing control
@@ -124,15 +124,15 @@ CSFML_WINDOW_API void sfWindowBase_close(sfWindowBase* windowBase);
/// \brief Tell whether or not a window is opened
///
/// This function returns whether or not the window exists.
/// Note that a hidden window (sfWindowBase_setVisible(sfFalse)) will return
/// sfTrue.
/// Note that a hidden window (sfWindowBase_setVisible(false)) will return
/// true.
///
/// \param windowBase Window object
///
/// \return sfTrue if the window is opened, sfFalse if it has been closed
/// \return true if the window is opened, false if it has been closed
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindowBase_isOpen(const sfWindowBase* windowBase);
CSFML_WINDOW_API bool sfWindowBase_isOpen(const sfWindowBase* windowBase);
////////////////////////////////////////////////////////////
/// \brief Pop the event on top of event queue, if any, and return it
@@ -146,10 +146,10 @@ CSFML_WINDOW_API sfBool sfWindowBase_isOpen(const sfWindowBase* windowBase);
/// \param windowBase Window object
/// \param event Event to be returned
///
/// \return sfTrue if an event was returned, or sfFalse if the event queue was empty
/// \return true if an event was returned, or false if the event queue was empty
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent* event);
CSFML_WINDOW_API bool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Wait for an event and return it
@@ -165,10 +165,10 @@ CSFML_WINDOW_API sfBool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent
/// \param windowBase Window object
/// \param event Event to be returned
///
/// \return sfFalse if any error occured
/// \return false if any error occured
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindowBase_waitEvent(sfWindowBase* windowBase, sfEvent* event);
CSFML_WINDOW_API bool sfWindowBase_waitEvent(sfWindowBase* windowBase, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Get the position of a window
@@ -231,7 +231,7 @@ CSFML_WINDOW_API void sfWindowBase_setTitle(sfWindowBase* windowBase, const char
/// \param title New title
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, const sfUint32* title);
CSFML_WINDOW_API void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, const uint32_t* title);
////////////////////////////////////////////////////////////
/// \brief Change a window's icon
@@ -245,25 +245,25 @@ CSFML_WINDOW_API void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, con
/// \param pixels Pointer to the array of pixels in memory
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_WINDOW_API void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const uint8_t* pixels);
////////////////////////////////////////////////////////////
/// \brief Show or hide a window
///
/// \param windowBase Window object
/// \param visible sfTrue to show the windowBase, sfFalse to hide it
/// \param visible true to show the windowBase, false to hide it
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_setVisible(sfWindowBase* windowBase, sfBool visible);
CSFML_WINDOW_API void sfWindowBase_setVisible(sfWindowBase* windowBase, bool visible);
////////////////////////////////////////////////////////////
/// \brief Show or hide the mouse cursor
///
/// \param windowBase Window object
/// \param visible sfTrue to show, sfFalse to hide
/// \param visible true to show, false to hide
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBase, sfBool visible);
CSFML_WINDOW_API void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBase, bool visible);
////////////////////////////////////////////////////////////
/// \brief Grab or release the mouse cursor
@@ -275,10 +275,10 @@ CSFML_WINDOW_API void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBas
/// won't have any effect (fullscreen windows always grab the
/// cursor).
///
/// \param grabbed sfTrue to enable, sfFalse to disable
/// \param grabbed true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_setMouseCursorGrabbed(sfWindowBase* windowBase, sfBool grabbed);
CSFML_WINDOW_API void sfWindowBase_setMouseCursorGrabbed(sfWindowBase* windowBase, bool grabbed);
////////////////////////////////////////////////////////////
/// \brief Set the displayed cursor to a native system cursor
@@ -310,10 +310,10 @@ CSFML_WINDOW_API void sfWindowBase_setMouseCursor(sfWindowBase* windowBase, cons
/// Key repeat is enabled by default.
///
/// \param windowBase Window object
/// \param enabled sfTrue to enable, sfFalse to disable
/// \param enabled true to enable, false to disable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_setKeyRepeatEnabled(sfWindowBase* windowBase, sfBool enabled);
CSFML_WINDOW_API void sfWindowBase_setKeyRepeatEnabled(sfWindowBase* windowBase, bool enabled);
////////////////////////////////////////////////////////////
/// \brief Change the joystick threshold
@@ -350,7 +350,7 @@ CSFML_WINDOW_API void sfWindowBase_requestFocus(sfWindowBase* windowBase);
/// \return True if window has focus, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindowBase_hasFocus(const sfWindowBase* windowBase);
CSFML_WINDOW_API bool sfWindowBase_hasFocus(const sfWindowBase* windowBase);
////////////////////////////////////////////////////////////
/// \brief Get the OS-specific handle of the window
@@ -379,6 +379,6 @@ CSFML_WINDOW_API sfWindowHandle sfWindowBase_getSystemHandle(const sfWindowBase*
/// \return True if surface creation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
CSFML_WINDOW_API bool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
#endif // SFML_WINDOWBASE_H
+7 -7
View File
@@ -83,16 +83,16 @@ void sfMusic_destroy(sfMusic* music)
////////////////////////////////////////////////////////////
void sfMusic_setLoop(sfMusic* music, sfBool loop)
void sfMusic_setLoop(sfMusic* music, bool loop)
{
CSFML_CALL(music, setLoop(loop != 0));
}
////////////////////////////////////////////////////////////
sfBool sfMusic_getLoop(const sfMusic* music)
bool sfMusic_getLoop(const sfMusic* music)
{
CSFML_CALL_RETURN(music, getLoop(), sfFalse);
CSFML_CALL_RETURN(music, getLoop(), false);
}
@@ -207,9 +207,9 @@ void sfMusic_setPosition(sfMusic* music, sfVector3f position)
////////////////////////////////////////////////////////////
void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative)
void sfMusic_setRelativeToListener(sfMusic* music, bool relative)
{
CSFML_CALL(music, setRelativeToListener(relative == sfTrue));
CSFML_CALL(music, setRelativeToListener(relative));
}
@@ -264,9 +264,9 @@ sfVector3f sfMusic_getPosition(const sfMusic* music)
////////////////////////////////////////////////////////////
sfBool sfMusic_isRelativeToListener(const sfMusic* music)
bool sfMusic_isRelativeToListener(const sfMusic* music)
{
CSFML_CALL_RETURN(music, isRelativeToListener(), sfFalse);
CSFML_CALL_RETURN(music, isRelativeToListener(), false);
}
+8 -8
View File
@@ -95,16 +95,16 @@ const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound)
////////////////////////////////////////////////////////////
void sfSound_setLoop(sfSound* sound, sfBool loop)
void sfSound_setLoop(sfSound* sound, bool loop)
{
CSFML_CALL(sound, setLoop(loop == sfTrue));
CSFML_CALL(sound, setLoop(loop));
}
////////////////////////////////////////////////////////////
sfBool sfSound_getLoop(const sfSound* sound)
bool sfSound_getLoop(const sfSound* sound)
{
CSFML_CALL_RETURN(sound, getLoop(), sfFalse);
CSFML_CALL_RETURN(sound, getLoop(), false);
}
@@ -139,9 +139,9 @@ void sfSound_setPosition(sfSound* sound, sfVector3f position)
////////////////////////////////////////////////////////////
void sfSound_setRelativeToListener(sfSound* sound, sfBool relative)
void sfSound_setRelativeToListener(sfSound* sound, bool relative)
{
CSFML_CALL(sound, setRelativeToListener(relative == sfTrue));
CSFML_CALL(sound, setRelativeToListener(relative));
}
@@ -196,9 +196,9 @@ sfVector3f sfSound_getPosition(const sfSound* sound)
////////////////////////////////////////////////////////////
sfBool sfSound_isRelativeToListener(const sfSound* sound)
bool sfSound_isRelativeToListener(const sfSound* sound)
{
CSFML_CALL_RETURN(sound, isRelativeToListener(), sfFalse);
CSFML_CALL_RETURN(sound, isRelativeToListener(), false);
}
+5 -5
View File
@@ -80,7 +80,7 @@ sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate)
sfSoundBuffer* sfSoundBuffer_createFromSamples(const int16_t* samples, uint64_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
{
sfSoundBuffer* buffer = new sfSoundBuffer;
@@ -111,21 +111,21 @@ void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer)
////////////////////////////////////////////////////////////
sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
bool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
{
CSFML_CALL_RETURN(soundBuffer, saveToFile(filename), sfFalse);
CSFML_CALL_RETURN(soundBuffer, saveToFile(filename), false);
}
////////////////////////////////////////////////////////////
const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer)
const int16_t* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer)
{
CSFML_CALL_RETURN(soundBuffer, getSamples(), nullptr);
}
////////////////////////////////////////////////////////////
sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer)
uint64_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer)
{
CSFML_CALL_RETURN(soundBuffer, getSampleCount(), 0);
}
+4 -4
View File
@@ -45,9 +45,9 @@ void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder)
////////////////////////////////////////////////////////////
sfBool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
bool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
{
CSFML_CALL_RETURN(soundBufferRecorder, start(sampleRate), sfFalse);
CSFML_CALL_RETURN(soundBufferRecorder, start(sampleRate), false);
}
@@ -76,9 +76,9 @@ const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder
}
////////////////////////////////////////////////////////////
sfBool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name)
bool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name)
{
CSFML_CALL_RETURN(soundBufferRecorder, setDevice(name), sfFalse);
CSFML_CALL_RETURN(soundBufferRecorder, setDevice(name), false);
}
////////////////////////////////////////////////////////////
+5 -5
View File
@@ -48,9 +48,9 @@ void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder)
////////////////////////////////////////////////////////////
sfBool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
bool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
{
CSFML_CALL_RETURN(soundRecorder, start(sampleRate), sfFalse);
CSFML_CALL_RETURN(soundRecorder, start(sampleRate), false);
}
@@ -69,7 +69,7 @@ unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder)
////////////////////////////////////////////////////////////
sfBool sfSoundRecorder_isAvailable(void)
bool sfSoundRecorder_isAvailable(void)
{
return sf::SoundRecorder::isAvailable();
}
@@ -113,9 +113,9 @@ const char* sfSoundRecorder_getDefaultDevice()
////////////////////////////////////////////////////////////
sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
bool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
{
CSFML_CALL_RETURN(soundRecorder, setDevice(name), sfFalse);
CSFML_CALL_RETURN(soundRecorder, setDevice(name), false);
}
+2 -2
View File
@@ -61,7 +61,7 @@ private :
virtual bool onStart()
{
if (myStartCallback)
return myStartCallback(myUserData) == sfTrue;
return myStartCallback(myUserData);
else
return true;
}
@@ -69,7 +69,7 @@ private :
virtual bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount)
{
if (myProcessCallback)
return myProcessCallback(samples, sampleCount, myUserData) == sfTrue;
return myProcessCallback(samples, sampleCount, myUserData);
else
return true;
}
+8 -8
View File
@@ -114,9 +114,9 @@ void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVector3f position)
////////////////////////////////////////////////////////////
void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative)
void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, bool relative)
{
CSFML_CALL(soundStream, setRelativeToListener(relative == sfTrue));
CSFML_CALL(soundStream, setRelativeToListener(relative));
}
@@ -142,9 +142,9 @@ void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream, sfTime timeOffse
////////////////////////////////////////////////////////////
void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop)
void sfSoundStream_setLoop(sfSoundStream* soundStream, bool loop)
{
CSFML_CALL(soundStream, setLoop(loop == sfTrue));
CSFML_CALL(soundStream, setLoop(loop));
}
@@ -178,9 +178,9 @@ sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundStream)
////////////////////////////////////////////////////////////
sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream)
bool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream)
{
CSFML_CALL_RETURN(soundStream, isRelativeToListener(), sfFalse);
CSFML_CALL_RETURN(soundStream, isRelativeToListener(), false);
}
@@ -199,9 +199,9 @@ float sfSoundStream_getAttenuation(const sfSoundStream* soundStream)
////////////////////////////////////////////////////////////
sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream)
bool sfSoundStream_getLoop(const sfSoundStream* soundStream)
{
CSFML_CALL_RETURN(soundStream, getLoop(), sfFalse);
CSFML_CALL_RETURN(soundStream, getLoop(), false);
}
+1 -1
View File
@@ -56,7 +56,7 @@ private :
virtual bool onGetData(Chunk& data)
{
sfSoundStreamChunk chunk = {nullptr, 0};
bool ok = (myGetDataCallback(&chunk, myUserData) == sfTrue);
bool ok = myGetDataCallback(&chunk, myUserData);
data.samples = chunk.samples;
data.sampleCount = chunk.sampleCount;
+4 -4
View File
@@ -56,10 +56,10 @@ inline void convertEvent(const sf::Event& sfmlEvent, sfEvent* event)
case sfEvtKeyPressed :
event->key.code = static_cast<sfKeyCode>(sfmlEvent.key.code);
event->key.scancode = static_cast<sfScancode>(sfmlEvent.key.scancode);
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.alt = sfmlEvent.key.alt;
event->key.control = sfmlEvent.key.control;
event->key.shift = sfmlEvent.key.shift;
event->key.system = sfmlEvent.key.system;
break;
case sfEvtMouseWheelMoved :
+2 -2
View File
@@ -177,9 +177,9 @@ sfTransform sfCircleShape_getInverseTransform(const sfCircleShape* shape)
////////////////////////////////////////////////////////////
void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect)
void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, bool resetRect)
{
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect == sfTrue));
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect));
shape->Texture = texture;
}
+21 -21
View File
@@ -43,14 +43,14 @@ sfColor sfTransparent = sfColor_fromRGBA( 0, 0, 0, 0);
////////////////////////////////////////////////////////////
sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue)
sfColor sfColor_fromRGB(uint8_t red, uint8_t green, uint8_t blue)
{
return sfColor_fromRGBA(red, green, blue, 255);
}
////////////////////////////////////////////////////////////
sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
sfColor sfColor_fromRGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
{
sfColor color;
@@ -64,21 +64,21 @@ sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha
////////////////////////////////////////////////////////////
sfColor sfColor_fromInteger(sfUint32 color)
sfColor sfColor_fromInteger(uint32_t color)
{
sfUint8 red = static_cast<sfUint8>((color & 0xff000000) >> 24);
sfUint8 green = static_cast<sfUint8>((color & 0x00ff0000) >> 16);
sfUint8 blue = static_cast<sfUint8>((color & 0x0000ff00) >> 8);
sfUint8 alpha = static_cast<sfUint8>((color & 0x000000ff) >> 0);
uint8_t red = static_cast<uint8_t>((color & 0xff000000) >> 24);
uint8_t green = static_cast<uint8_t>((color & 0x00ff0000) >> 16);
uint8_t blue = static_cast<uint8_t>((color & 0x0000ff00) >> 8);
uint8_t alpha = static_cast<uint8_t>((color & 0x000000ff) >> 0);
return sfColor_fromRGBA(red, green, blue, alpha);
}
////////////////////////////////////////////////////////////
sfUint32 sfColor_toInteger(sfColor color)
uint32_t sfColor_toInteger(sfColor color)
{
return static_cast<sfUint32>((color.r << 24) | (color.g << 16) | (color.b << 8) | color.a);
return static_cast<uint32_t>((color.r << 24) | (color.g << 16) | (color.b << 8) | color.a);
}
@@ -90,10 +90,10 @@ sfColor sfColor_add(sfColor color1, sfColor color2)
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),
static_cast<sfUint8>(green),
static_cast<sfUint8>(blue),
static_cast<sfUint8>(alpha));
return sfColor_fromRGBA(static_cast<uint8_t>(red),
static_cast<uint8_t>(green),
static_cast<uint8_t>(blue),
static_cast<uint8_t>(alpha));
}
@@ -105,10 +105,10 @@ sfColor sfColor_subtract(sfColor color1, sfColor color2)
int blue = std::max(color1.b - color2.b, 0);
int alpha = std::max(color1.a - color2.a, 0);
return sfColor_fromRGBA(static_cast<sfUint8>(red),
static_cast<sfUint8>(green),
static_cast<sfUint8>(blue),
static_cast<sfUint8>(alpha));
return sfColor_fromRGBA(static_cast<uint8_t>(red),
static_cast<uint8_t>(green),
static_cast<uint8_t>(blue),
static_cast<uint8_t>(alpha));
}
@@ -120,8 +120,8 @@ sfColor sfColor_modulate(sfColor color1, sfColor color2)
int blue = color1.b * color2.b / 255;
int alpha = color1.a * color2.a / 255;
return sfColor_fromRGBA(static_cast<sfUint8>(red),
static_cast<sfUint8>(green),
static_cast<sfUint8>(blue),
static_cast<sfUint8>(alpha));
return sfColor_fromRGBA(static_cast<uint8_t>(red),
static_cast<uint8_t>(green),
static_cast<uint8_t>(blue),
static_cast<uint8_t>(alpha));
}
+2 -2
View File
@@ -174,9 +174,9 @@ sfTransform sfConvexShape_getInverseTransform(const sfConvexShape* shape)
////////////////////////////////////////////////////////////
void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect)
void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, bool resetRect)
{
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect == sfTrue));
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect));
shape->Texture = texture;
}
+8 -13
View File
@@ -93,12 +93,12 @@ void sfFont_destroy(sfFont* font)
////////////////////////////////////////////////////////////
sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness)
sfGlyph sfFont_getGlyph(const sfFont* font, uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness)
{
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, outlineThickness);
sf::Glyph SFMLGlyph = font->This.getGlyph(codePoint, characterSize, bold, outlineThickness);
glyph.advance = SFMLGlyph.advance;
glyph.bounds.left = SFMLGlyph.bounds.left;
@@ -115,14 +115,14 @@ sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoint, unsigned int cha
////////////////////////////////////////////////////////////
float sfFont_getKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize)
float sfFont_getKerning(const sfFont* font, uint32_t first, uint32_t second, unsigned int characterSize)
{
CSFML_CALL_RETURN(font, getKerning(first, second, characterSize), 0);
}
////////////////////////////////////////////////////////////
float sfFont_getBoldKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize)
float sfFont_getBoldKerning(const sfFont* font, uint32_t first, uint32_t second, unsigned int characterSize)
{
CSFML_CALL_RETURN(font, getKerning(first, second, characterSize, true), 0);
}
@@ -161,21 +161,16 @@ const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize)
////////////////////////////////////////////////////////////
void sfFont_setSmooth(sfFont* font, sfBool smooth)
void sfFont_setSmooth(sfFont* font, bool smooth)
{
font->This.setSmooth(smooth == sfTrue);
font->This.setSmooth(smooth);
}
////////////////////////////////////////////////////////////
sfBool sfFont_isSmooth(const sfFont *font)
bool sfFont_isSmooth(const sfFont *font)
{
if (font->This.isSmooth())
{
return sfTrue;
}
return sfFalse;
return font->This.isSmooth();
}
+10 -10
View File
@@ -53,7 +53,7 @@ sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColo
////////////////////////////////////////////////////////////
sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* data)
sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const uint8_t* data)
{
sfImage* image = new sfImage;
image->This.create(width, height, data);
@@ -127,33 +127,33 @@ void sfImage_destroy(sfImage* image)
////////////////////////////////////////////////////////////
sfBool sfImage_saveToFile(const sfImage* image, const char* filename)
bool sfImage_saveToFile(const sfImage* image, const char* filename)
{
CSFML_CALL_RETURN(image, saveToFile(filename), sfFalse);
CSFML_CALL_RETURN(image, saveToFile(filename), false);
}
////////////////////////////////////////////////////////////
sfBool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* format)
bool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* format)
{
CSFML_CHECK_RETURN(output, sfFalse);
CSFML_CALL_RETURN(image, saveToMemory(output->buffer, format), sfFalse);
CSFML_CHECK_RETURN(output, false);
CSFML_CALL_RETURN(image, saveToMemory(output->buffer, format), false);
}
////////////////////////////////////////////////////////////
void sfImage_createMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha)
void sfImage_createMaskFromColor(sfImage* image, sfColor colorKey, uint8_t 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, bool 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));
CSFML_CALL(image, copy(source->This, destX, destY, sfmlRect, applyAlpha));
}
@@ -177,7 +177,7 @@ sfColor sfImage_getPixel(const sfImage* image, unsigned int x, unsigned int y)
////////////////////////////////////////////////////////////
const sfUint8* sfImage_getPixelsPtr(const sfImage* image)
const uint8_t* sfImage_getPixelsPtr(const sfImage* image)
{
CSFML_CALL_RETURN(image, getPixelsPtr(), nullptr);
}
+10 -10
View File
@@ -48,14 +48,14 @@ sfVector2i toCType(const sf::Vector2i& vector)
////////////////////////////////////////////////////////////
/// Check if a point is inside a rectangle's area
////////////////////////////////////////////////////////////
sfBool sfFloatRect_contains(const sfFloatRect* rect, float x, float y)
bool sfFloatRect_contains(const sfFloatRect* rect, float x, float y)
{
CSFML_CHECK_RETURN(rect, sfFalse);
CSFML_CHECK_RETURN(rect, false);
return sf::FloatRect(rect->left, rect->top, rect->width, rect->height).contains(x, y);
}
sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y)
bool sfIntRect_contains(const sfIntRect* rect, int x, int y)
{
CSFML_CHECK_RETURN(rect, sfFalse);
CSFML_CHECK_RETURN(rect, false);
return sf::IntRect(rect->left, rect->top, rect->width, rect->height).contains(x, y);
}
@@ -63,10 +63,10 @@ sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y)
////////////////////////////////////////////////////////////
/// Check intersection between two rectangles
////////////////////////////////////////////////////////////
sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection)
bool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection)
{
CSFML_CHECK_RETURN(rect1, sfFalse);
CSFML_CHECK_RETURN(rect2, sfFalse);
CSFML_CHECK_RETURN(rect1, false);
CSFML_CHECK_RETURN(rect2, false);
sf::FloatRect SFMLRect1(rect1->left, rect1->top, rect1->width, rect1->height);
sf::FloatRect SFMLRect2(rect2->left, rect2->top, rect2->width, rect2->height);
@@ -88,10 +88,10 @@ sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2
return SFMLRect1.intersects(SFMLRect2);
}
}
sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection)
bool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection)
{
CSFML_CHECK_RETURN(rect1, sfFalse);
CSFML_CHECK_RETURN(rect2, sfFalse);
CSFML_CHECK_RETURN(rect1, false);
CSFML_CHECK_RETURN(rect2, false);
sf::IntRect SFMLRect1(rect1->left, rect1->top, rect1->width, rect1->height);
sf::IntRect SFMLRect2(rect2->left, rect2->top, rect2->width, rect2->height);
+2 -2
View File
@@ -174,9 +174,9 @@ sfTransform sfRectangleShape_getInverseTransform(const sfRectangleShape* shape)
////////////////////////////////////////////////////////////
void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect)
void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, bool resetRect)
{
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect == sfTrue));
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect));
shape->Texture = texture;
}
+16 -16
View File
@@ -41,10 +41,10 @@
////////////////////////////////////////////////////////////
sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer)
sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, bool depthBuffer)
{
sfRenderTexture* renderTexture = new sfRenderTexture;
renderTexture->This.create(width, height, depthBuffer == sfTrue);
renderTexture->This.create(width, height, depthBuffer);
renderTexture->Target = new sfTexture(const_cast<sf::Texture*>(&renderTexture->This.getTexture()));
renderTexture->DefaultView.This = renderTexture->This.getDefaultView();
renderTexture->CurrentView.This = renderTexture->This.getView();
@@ -97,17 +97,17 @@ sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture)
////////////////////////////////////////////////////////////
sfBool sfRenderTexture_isSrgb(const sfRenderTexture* renderTexture)
bool sfRenderTexture_isSrgb(const sfRenderTexture* renderTexture)
{
CSFML_CHECK_RETURN(renderTexture, sfFalse);
CSFML_CHECK_RETURN(renderTexture, false);
return renderTexture->This.isSrgb();
}
////////////////////////////////////////////////////////////
sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active)
bool sfRenderTexture_setActive(sfRenderTexture* renderTexture, bool active)
{
CSFML_CALL_RETURN(renderTexture, setActive(active == sfTrue), sfFalse);
CSFML_CALL_RETURN(renderTexture, setActive(active), false);
}
@@ -303,9 +303,9 @@ const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture
////////////////////////////////////////////////////////////
void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth)
void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, bool smooth)
{
CSFML_CALL(renderTexture, setSmooth(smooth == sfTrue));
CSFML_CALL(renderTexture, setSmooth(smooth));
}
@@ -317,27 +317,27 @@ unsigned int sfRenderTexture_getMaximumAntialiasingLevel()
////////////////////////////////////////////////////////////
sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture)
bool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture)
{
CSFML_CALL_RETURN(renderTexture, isSmooth(), sfFalse);
CSFML_CALL_RETURN(renderTexture, isSmooth(), false);
}
////////////////////////////////////////////////////////////
void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated)
void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, bool repeated)
{
CSFML_CALL(renderTexture, setRepeated(repeated == sfTrue));
CSFML_CALL(renderTexture, setRepeated(repeated));
}
////////////////////////////////////////////////////////////
sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture)
bool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture)
{
CSFML_CALL_RETURN(renderTexture, isRepeated(), sfFalse);
CSFML_CALL_RETURN(renderTexture, isRepeated(), false);
}
////////////////////////////////////////////////////////////
sfBool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture)
bool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture)
{
CSFML_CALL_RETURN(renderTexture, generateMipmap(), sfFalse);
CSFML_CALL_RETURN(renderTexture, generateMipmap(), false);
}
+34 -34
View File
@@ -45,7 +45,7 @@
////////////////////////////////////////////////////////////
sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings)
sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, uint32_t style, const sfContextSettings* settings)
{
// Convert video mode
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
@@ -67,7 +67,7 @@ sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUin
}
////////////////////////////////////////////////////////////
sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings)
sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const uint32_t* title, uint32_t style, const sfContextSettings* settings)
{
// Convert video mode
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
@@ -124,9 +124,9 @@ void sfRenderWindow_close(sfRenderWindow* renderWindow)
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow)
bool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow)
{
CSFML_CALL_RETURN(renderWindow, isOpen(), sfFalse);
CSFML_CALL_RETURN(renderWindow, isOpen(), false);
}
@@ -144,44 +144,44 @@ sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow)
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event)
bool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event)
{
CSFML_CHECK_RETURN(renderWindow, sfFalse);
CSFML_CHECK_RETURN(event, sfFalse);
CSFML_CHECK_RETURN(renderWindow, false);
CSFML_CHECK_RETURN(event, false);
// Get the event
sf::Event sfmlEvent;
sfBool ret = renderWindow->This.pollEvent(sfmlEvent);
bool ret = renderWindow->This.pollEvent(sfmlEvent);
// No event, return
if (!ret)
return sfFalse;
return false;
// Convert the sf::Event event to a sfEvent
convertEvent(sfmlEvent, event);
return sfTrue;
return true;
}
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event)
bool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event)
{
CSFML_CHECK_RETURN(renderWindow, sfFalse);
CSFML_CHECK_RETURN(event, sfFalse);
CSFML_CHECK_RETURN(renderWindow, false);
CSFML_CHECK_RETURN(event, false);
// Get the event
sf::Event sfmlEvent;
sfBool ret = renderWindow->This.waitEvent(sfmlEvent);
bool ret = renderWindow->This.waitEvent(sfmlEvent);
// Error, return
if (!ret)
return sfFalse;
return false;
// Convert the sf::Event event to a sfEvent
convertEvent(sfmlEvent, event);
return sfTrue;
return true;
}
@@ -221,9 +221,9 @@ sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow)
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_isSrgb(const sfRenderWindow* renderWindow)
bool sfRenderWindow_isSrgb(const sfRenderWindow* renderWindow)
{
CSFML_CHECK_RETURN(renderWindow, sfFalse);
CSFML_CHECK_RETURN(renderWindow, false);
return renderWindow->This.isSrgb();
}
@@ -243,44 +243,44 @@ void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title)
////////////////////////////////////////////////////////////
void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title)
void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const uint32_t* 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 uint8_t* pixels)
{
CSFML_CALL(renderWindow, setIcon(width, height, pixels));
}
////////////////////////////////////////////////////////////
void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible)
void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, bool visible)
{
CSFML_CALL(renderWindow, setVisible(visible == sfTrue));
CSFML_CALL(renderWindow, setVisible(visible));
}
////////////////////////////////////////////////////////////
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled)
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, bool enabled)
{
CSFML_CALL(renderWindow, setVerticalSyncEnabled(enabled == sfTrue));
CSFML_CALL(renderWindow, setVerticalSyncEnabled(enabled));
}
////////////////////////////////////////////////////////////
void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool visible)
void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, bool visible)
{
CSFML_CALL(renderWindow, setMouseCursorVisible(visible == sfTrue));
CSFML_CALL(renderWindow, setMouseCursorVisible(visible));
}
////////////////////////////////////////////////////////////
void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed)
void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, bool grabbed)
{
CSFML_CALL(renderWindow, setMouseCursorGrabbed(grabbed == sfTrue));
CSFML_CALL(renderWindow, setMouseCursorGrabbed(grabbed));
}
@@ -294,16 +294,16 @@ void sfRenderWindow_setMouseCursor(sfRenderWindow* window, const sfCursor* curso
////////////////////////////////////////////////////////////
void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled)
void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, bool enabled)
{
CSFML_CALL(renderWindow, setKeyRepeatEnabled(enabled == sfTrue));
CSFML_CALL(renderWindow, setKeyRepeatEnabled(enabled));
}
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active)
bool sfRenderWindow_setActive(sfRenderWindow* renderWindow, bool active)
{
CSFML_CALL_RETURN(renderWindow, setActive(active == sfTrue), sfFalse);
CSFML_CALL_RETURN(renderWindow, setActive(active), false);
}
@@ -315,9 +315,9 @@ void sfRenderWindow_requestFocus(sfRenderWindow* renderWindow)
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow)
bool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow)
{
CSFML_CALL_RETURN(renderWindow, hasFocus(), sfFalse);
CSFML_CALL_RETURN(renderWindow, hasFocus(), false);
}
+9 -9
View File
@@ -278,30 +278,30 @@ void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor col
}
////////////////////////////////////////////////////////////
void sfShader_setBoolUniform(sfShader* shader, const char* name, sfBool x)
void sfShader_setBoolUniform(sfShader* shader, const char* name, bool x)
{
CSFML_CALL(shader, setUniform(name, x != sfFalse));
CSFML_CALL(shader, setUniform(name, x));
}
////////////////////////////////////////////////////////////
void sfShader_setBvec2Uniform(sfShader* shader, const char* name, sfGlslBvec2 vector)
{
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec2(vector.x != sfFalse, vector.y != sfFalse)));
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec2(vector.x, vector.y)));
}
////////////////////////////////////////////////////////////
void sfShader_setBvec3Uniform(sfShader* shader, const char* name, sfGlslBvec3 vector)
{
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec3(vector.x != sfFalse, vector.y != sfFalse, vector.z != sfFalse)));
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec3(vector.x, vector.y, vector.z)));
}
////////////////////////////////////////////////////////////
void sfShader_setBvec4Uniform(sfShader* shader, const char* name, sfGlslBvec4 vector)
{
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec4(vector.x != sfFalse, vector.y != sfFalse, vector.z != sfFalse, vector.w != sfFalse)));
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec4(vector.x, vector.y, vector.z, vector.w)));
}
@@ -461,14 +461,14 @@ void sfShader_bind(const sfShader* shader)
////////////////////////////////////////////////////////////
sfBool sfShader_isAvailable(void)
bool sfShader_isAvailable(void)
{
return sf::Shader::isAvailable() ? sfTrue : sfFalse;
return sf::Shader::isAvailable();
}
////////////////////////////////////////////////////////////
sfBool sfShader_isGeometryAvailable(void)
bool sfShader_isGeometryAvailable(void)
{
return sf::Shader::isGeometryAvailable() ? sfTrue : sfFalse;
return sf::Shader::isGeometryAvailable();
}
+2 -2
View File
@@ -167,9 +167,9 @@ sfTransform sfShape_getInverseTransform(const sfShape* shape)
////////////////////////////////////////////////////////////
void sfShape_setTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect)
void sfShape_setTexture(sfShape* shape, const sfTexture* texture, bool resetRect)
{
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect == sfTrue));
CSFML_CALL(shape, setTexture(texture ? texture->This : nullptr, resetRect));
shape->Texture = texture;
}
+2 -2
View File
@@ -178,11 +178,11 @@ sfTransform sfSprite_getInverseTransform(const sfSprite* sprite)
////////////////////////////////////////////////////////////
void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect)
void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, bool resetRect)
{
if (texture && texture->This)
{
CSFML_CALL(sprite, setTexture(*texture->This, resetRect == sfTrue));
CSFML_CALL(sprite, setTexture(*texture->This, resetRect));
sprite->Texture = texture;
}
}
+4 -4
View File
@@ -185,7 +185,7 @@ void sfText_setString(sfText* text, const char* string)
////////////////////////////////////////////////////////////
void sfText_setUnicodeString(sfText* text, const sfUint32* string)
void sfText_setUnicodeString(sfText* text, const uint32_t* string)
{
sf::String UTF32Text = string;
CSFML_CALL(text, setString(UTF32Text));
@@ -224,7 +224,7 @@ void sfText_setLetterSpacing(sfText* text, float spacingFactor)
////////////////////////////////////////////////////////////
void sfText_setStyle(sfText* text, sfUint32 style)
void sfText_setStyle(sfText* text, uint32_t style)
{
CSFML_CALL(text, setStyle(style));
}
@@ -270,7 +270,7 @@ const char* sfText_getString(const sfText* text)
////////////////////////////////////////////////////////////
const sfUint32* sfText_getUnicodeString(const sfText* text)
const uint32_t* sfText_getUnicodeString(const sfText* text)
{
CSFML_CHECK_RETURN(text, nullptr);
@@ -310,7 +310,7 @@ float sfText_getLineSpacing(const sfText* text)
////////////////////////////////////////////////////////////
sfUint32 sfText_getStyle(const sfText* text)
uint32_t sfText_getStyle(const sfText* text)
{
CSFML_CALL_RETURN(text, getStyle(), 0);
}
+15 -15
View File
@@ -258,7 +258,7 @@ sfImage* sfTexture_copyToImage(const sfTexture* texture)
////////////////////////////////////////////////////////////
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 uint8_t* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)
{
CSFML_CALL_PTR(texture, update(pixels, width, height, x, y));
}
@@ -302,49 +302,49 @@ void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow*
////////////////////////////////////////////////////////////
void sfTexture_setSmooth(sfTexture* texture, sfBool smooth)
void sfTexture_setSmooth(sfTexture* texture, bool smooth)
{
CSFML_CALL_PTR(texture, setSmooth(smooth == sfTrue));
CSFML_CALL_PTR(texture, setSmooth(smooth));
}
////////////////////////////////////////////////////////////
sfBool sfTexture_isSmooth(const sfTexture* texture)
bool sfTexture_isSmooth(const sfTexture* texture)
{
CSFML_CHECK_RETURN(texture, sfFalse);
CSFML_CHECK_RETURN(texture->This, sfFalse);
CSFML_CHECK_RETURN(texture, false);
CSFML_CHECK_RETURN(texture->This, false);
return texture->This->isSmooth();
}
////////////////////////////////////////////////////////////
sfBool sfTexture_isSrgb(const sfTexture* texture)
bool sfTexture_isSrgb(const sfTexture* texture)
{
CSFML_CALL_PTR_RETURN(texture, isSrgb(), sfFalse);
CSFML_CALL_PTR_RETURN(texture, isSrgb(), false);
}
////////////////////////////////////////////////////////////
void sfTexture_setRepeated(sfTexture* texture, sfBool repeated)
void sfTexture_setRepeated(sfTexture* texture, bool repeated)
{
CSFML_CALL_PTR(texture, setRepeated(repeated == sfTrue));
CSFML_CALL_PTR(texture, setRepeated(repeated));
}
////////////////////////////////////////////////////////////
sfBool sfTexture_isRepeated(const sfTexture* texture)
bool sfTexture_isRepeated(const sfTexture* texture)
{
CSFML_CHECK_RETURN(texture, sfFalse);
CSFML_CHECK_RETURN(texture->This, sfFalse);
CSFML_CHECK_RETURN(texture, false);
CSFML_CHECK_RETURN(texture->This, false);
return texture->This->isRepeated();
}
////////////////////////////////////////////////////////////
sfBool sfTexture_generateMipmap(sfTexture* texture)
bool sfTexture_generateMipmap(sfTexture* texture)
{
CSFML_CALL_PTR_RETURN(texture, generateMipmap(), sfFalse);
CSFML_CALL_PTR_RETURN(texture, generateMipmap(), false);
}
+3 -3
View File
@@ -159,13 +159,13 @@ void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float sca
////////////////////////////////////////////////////////////
sfBool sfTransform_equal(sfTransform* left, sfTransform* right)
bool sfTransform_equal(sfTransform* left, sfTransform* right)
{
CSFML_CHECK_RETURN(left, false);
CSFML_CHECK_RETURN(right, false);
for (int i = 0; i < 9; ++i) {
if (left->matrix[i] != right->matrix[i]) return sfFalse;
if (left->matrix[i] != right->matrix[i]) return false;
}
return sfTrue;
return true;
}
+6 -6
View File
@@ -75,17 +75,17 @@ unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer* vertexBuffer)
////////////////////////////////////////////////////////////
sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset)
bool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset)
{
// the cast is safe, sfVertex has to be binary compatible with sf::Vertex
CSFML_CALL_RETURN(vertexBuffer, update(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount, offset), sfFalse);
CSFML_CALL_RETURN(vertexBuffer, update(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount, offset), false);
}
////////////////////////////////////////////////////////////
sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other)
bool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other)
{
CSFML_CALL_RETURN(vertexBuffer, update(other->This), sfFalse);
CSFML_CALL_RETURN(vertexBuffer, update(other->This), false);
}
@@ -143,7 +143,7 @@ void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer)
////////////////////////////////////////////////////////////
sfBool sfVertexBuffer_isAvailable()
bool sfVertexBuffer_isAvailable()
{
return sf::VertexBuffer::isAvailable() ? sfTrue : sfFalse;
return sf::VertexBuffer::isAvailable();
}
+8 -8
View File
@@ -39,9 +39,9 @@ void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse)
////////////////////////////////////////////////////////////
sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse)
bool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse)
{
CSFML_CALL_RETURN(ftpListingResponse, isOk(), sfFalse);
CSFML_CALL_RETURN(ftpListingResponse, isOk(), false);
}
@@ -89,9 +89,9 @@ void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse
////////////////////////////////////////////////////////////
sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse)
bool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse)
{
CSFML_CALL_RETURN(ftpDirectoryResponse, isOk(), sfFalse);
CSFML_CALL_RETURN(ftpDirectoryResponse, isOk(), false);
}
@@ -130,9 +130,9 @@ void sfFtpResponse_destroy(sfFtpResponse* ftpResponse)
////////////////////////////////////////////////////////////
sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse)
bool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse)
{
CSFML_CALL_RETURN(ftpResponse, isOk(), sfFalse);
CSFML_CALL_RETURN(ftpResponse, isOk(), false);
}
@@ -299,14 +299,14 @@ sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* lo
////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, sfBool append)
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, bool append)
{
CSFML_CHECK_RETURN(ftp, nullptr);
return new sfFtpResponse(ftp->This.upload(localFile ? localFile : "",
remotePath ? remotePath : "",
static_cast<sf::Ftp::TransferMode>(mode),
append == sfTrue));
append));
}
+3 -3
View File
@@ -73,14 +73,14 @@ sfIpAddress sfIpAddress_fromString(const char* address)
////////////////////////////////////////////////////////////
sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3)
sfIpAddress sfIpAddress_fromBytes(uint8_t byte0, uint8_t byte1, uint8_t byte2, uint8_t byte3)
{
return fromSFMLAddress(sf::IpAddress(byte0, byte1, byte2, byte3));
}
////////////////////////////////////////////////////////////
sfIpAddress sfIpAddress_fromInteger(sfUint32 address)
sfIpAddress sfIpAddress_fromInteger(uint32_t address)
{
return fromSFMLAddress(sf::IpAddress(address));
}
@@ -95,7 +95,7 @@ void sfIpAddress_toString(sfIpAddress address, char* string)
////////////////////////////////////////////////////////////
sfUint32 sfIpAddress_toInteger(sfIpAddress address)
uint32_t sfIpAddress_toInteger(sfIpAddress address)
{
return toSFMLAddress(address).toInteger();
}
+33 -33
View File
@@ -89,77 +89,77 @@ size_t sfPacket_getDataSize(const sfPacket* packet)
////////////////////////////////////////////////////////////
sfBool sfPacket_endOfPacket(const sfPacket* packet)
bool sfPacket_endOfPacket(const sfPacket* packet)
{
CSFML_CALL_RETURN(packet, endOfPacket(), sfFalse);
CSFML_CALL_RETURN(packet, endOfPacket(), false);
}
////////////////////////////////////////////////////////////
sfBool sfPacket_canRead(const sfPacket* packet)
bool sfPacket_canRead(const sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
return packet->This ? sfTrue : sfFalse;
CSFML_CHECK_RETURN(packet, false);
return packet->This;
}
////////////////////////////////////////////////////////////
sfBool sfPacket_readBool(sfPacket* packet)
bool sfPacket_readBool(sfPacket* packet)
{
return sfPacket_readUint8(packet);
}
sfInt8 sfPacket_readInt8(sfPacket* packet)
int8_t sfPacket_readInt8(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
sfInt8 value;
CSFML_CHECK_RETURN(packet, false);
int8_t value;
packet->This >> value;
return value;
}
sfUint8 sfPacket_readUint8(sfPacket* packet)
uint8_t sfPacket_readUint8(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
sfUint8 value;
CSFML_CHECK_RETURN(packet, false);
uint8_t value;
packet->This >> value;
return value;
}
sfInt16 sfPacket_readInt16(sfPacket* packet)
int16_t sfPacket_readInt16(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
sfInt16 value;
CSFML_CHECK_RETURN(packet, false);
int16_t value;
packet->This >> value;
return value;
}
sfUint16 sfPacket_readUint16(sfPacket* packet)
uint16_t sfPacket_readUint16(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
sfUint16 value;
CSFML_CHECK_RETURN(packet, false);
uint16_t value;
packet->This >> value;
return value;
}
sfInt32 sfPacket_readInt32(sfPacket* packet)
int32_t sfPacket_readInt32(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
sfInt32 value;
CSFML_CHECK_RETURN(packet, false);
int32_t value;
packet->This >> value;
return value;
}
sfUint32 sfPacket_readUint32(sfPacket* packet)
uint32_t sfPacket_readUint32(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
sfUint32 value;
CSFML_CHECK_RETURN(packet, false);
uint32_t value;
packet->This >> value;
return value;
}
float sfPacket_readFloat(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
CSFML_CHECK_RETURN(packet, false);
float value;
packet->This >> value;
return value;
}
double sfPacket_readDouble(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, sfFalse);
CSFML_CHECK_RETURN(packet, false);
double value;
packet->This >> value;
return value;
@@ -179,36 +179,36 @@ void sfPacket_readWideString(sfPacket* packet, wchar_t* string)
////////////////////////////////////////////////////////////
void sfPacket_writeBool(sfPacket* packet, sfBool value)
void sfPacket_writeBool(sfPacket* packet, bool value)
{
sfPacket_writeUint8(packet, value ? 1 : 0);
}
void sfPacket_writeInt8(sfPacket* packet, sfInt8 value)
void sfPacket_writeInt8(sfPacket* packet, int8_t value)
{
CSFML_CHECK(packet);
packet->This << value;
}
void sfPacket_writeUint8(sfPacket* packet, sfUint8 value)
void sfPacket_writeUint8(sfPacket* packet, uint8_t value)
{
CSFML_CHECK(packet);
packet->This << value;
}
void sfPacket_writeInt16(sfPacket* packet, sfInt16 value)
void sfPacket_writeInt16(sfPacket* packet, int16_t value)
{
CSFML_CHECK(packet);
packet->This << value;
}
void sfPacket_writeUint16(sfPacket* packet, sfUint16 value)
void sfPacket_writeUint16(sfPacket* packet, uint16_t value)
{
CSFML_CHECK(packet);
packet->This << value;
}
void sfPacket_writeInt32(sfPacket* packet, sfInt32 value)
void sfPacket_writeInt32(sfPacket* packet, int32_t value)
{
CSFML_CHECK(packet);
packet->This << value;
}
void sfPacket_writeUint32(sfPacket* packet, sfUint32 value)
void sfPacket_writeUint32(sfPacket* packet, uint32_t value)
{
CSFML_CHECK(packet);
packet->This << value;
+11 -11
View File
@@ -100,25 +100,25 @@ void sfSocketSelector_clear(sfSocketSelector* selector)
////////////////////////////////////////////////////////////
sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout)
bool 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)), false);
}
////////////////////////////////////////////////////////////
sfBool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket)
bool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket)
{
CSFML_CHECK_RETURN(socket, sfFalse);
CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse);
CSFML_CHECK_RETURN(socket, false);
CSFML_CALL_RETURN(selector, isReady(socket->This), false);
}
sfBool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket)
bool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket)
{
CSFML_CHECK_RETURN(socket, sfFalse);
CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse);
CSFML_CHECK_RETURN(socket, false);
CSFML_CALL_RETURN(selector, isReady(socket->This), false);
}
sfBool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket)
bool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket)
{
CSFML_CHECK_RETURN(socket, sfFalse);
CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse);
CSFML_CHECK_RETURN(socket, false);
CSFML_CALL_RETURN(selector, isReady(socket->This), false);
}
+4 -4
View File
@@ -46,16 +46,16 @@ void sfTcpListener_destroy(sfTcpListener* listener)
////////////////////////////////////////////////////////////
void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking)
void sfTcpListener_setBlocking(sfTcpListener* listener, bool blocking)
{
CSFML_CALL(listener, setBlocking(blocking == sfTrue));
CSFML_CALL(listener, setBlocking(blocking));
}
////////////////////////////////////////////////////////////
sfBool sfTcpListener_isBlocking(const sfTcpListener* listener)
bool sfTcpListener_isBlocking(const sfTcpListener* listener)
{
CSFML_CALL_RETURN(listener, isBlocking(), sfFalse);
CSFML_CALL_RETURN(listener, isBlocking(), false);
}
+4 -4
View File
@@ -48,16 +48,16 @@ void sfTcpSocket_destroy(sfTcpSocket* socket)
////////////////////////////////////////////////////////////
void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking)
void sfTcpSocket_setBlocking(sfTcpSocket* socket, bool blocking)
{
CSFML_CALL(socket, setBlocking(blocking == sfTrue));
CSFML_CALL(socket, setBlocking(blocking));
}
////////////////////////////////////////////////////////////
sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket)
bool sfTcpSocket_isBlocking(const sfTcpSocket* socket)
{
CSFML_CALL_RETURN(socket, isBlocking(), sfFalse);
CSFML_CALL_RETURN(socket, isBlocking(), false);
}
+4 -4
View File
@@ -48,15 +48,15 @@ void sfUdpSocket_destroy(sfUdpSocket* socket)
////////////////////////////////////////////////////////////
void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking)
void sfUdpSocket_setBlocking(sfUdpSocket* socket, bool blocking)
{
CSFML_CALL(socket, setBlocking(blocking == sfTrue));
CSFML_CALL(socket, setBlocking(blocking));
}
////////////////////////////////////////////////////////////
sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket)
bool sfUdpSocket_isBlocking(const sfUdpSocket* socket)
{
CSFML_CALL_RETURN(socket, isBlocking(), sfFalse);
CSFML_CALL_RETURN(socket, isBlocking(), false);
}
+1 -1
View File
@@ -53,7 +53,7 @@ size_t sfBuffer_getSize(const sfBuffer* buffer)
////////////////////////////////////////////////////////////
const sfUint8* sfBuffer_getData(const sfBuffer* buffer)
const uint8_t* sfBuffer_getData(const sfBuffer* buffer)
{
CSFML_CHECK_RETURN(buffer, nullptr);
return !buffer->buffer.empty() ? &buffer->buffer[0] : nullptr;
+7 -7
View File
@@ -40,14 +40,14 @@ float sfTime_asSeconds(sfTime time)
////////////////////////////////////////////////////////////
sfInt32 sfTime_asMilliseconds(sfTime time)
int32_t sfTime_asMilliseconds(sfTime time)
{
return static_cast<sfInt32>(time.microseconds / 1000);
return static_cast<int32_t>(time.microseconds / 1000);
}
////////////////////////////////////////////////////////////
sfInt64 sfTime_asMicroseconds(sfTime time)
int64_t sfTime_asMicroseconds(sfTime time)
{
return time.microseconds;
}
@@ -57,22 +57,22 @@ sfInt64 sfTime_asMicroseconds(sfTime time)
sfTime sfSeconds(float amount)
{
sfTime time;
time.microseconds = static_cast<sfInt64>(amount * 1000000);
time.microseconds = static_cast<int64_t>(amount * 1000000);
return time;
}
////////////////////////////////////////////////////////////
sfTime sfMilliseconds(sfInt32 amount)
sfTime sfMilliseconds(int32_t amount)
{
sfTime time;
time.microseconds = static_cast<sfInt64>(amount) * 1000;
time.microseconds = static_cast<int64_t>(amount) * 1000;
return time;
}
////////////////////////////////////////////////////////////
sfTime sfMicroseconds(sfInt64 amount)
sfTime sfMicroseconds(int64_t amount)
{
sfTime time;
time.microseconds = amount;
+2 -2
View File
@@ -46,7 +46,7 @@ const char* sfClipboard_getString()
////////////////////////////////////////////////////////////
const sfUint32* sfClipboard_getUnicodeString()
const uint32_t* sfClipboard_getUnicodeString()
{
ClipboardString = sf::Clipboard::getString();
return ClipboardString.getData();
@@ -61,7 +61,7 @@ void sfClipboard_setString(const char* text)
////////////////////////////////////////////////////////////
void sfClipboard_setUnicodeString(const sfUint32* text)
void sfClipboard_setUnicodeString(const uint32_t* text)
{
sf::Clipboard::setString(text);
}
+4 -4
View File
@@ -46,16 +46,16 @@ void sfContext_destroy(sfContext* context)
////////////////////////////////////////////////////////////
sfBool sfContext_isExtensionAvailable(const char* name)
bool sfContext_isExtensionAvailable(const char* name)
{
return sf::Context::isExtensionAvailable(name);
}
////////////////////////////////////////////////////////////
sfBool sfContext_setActive(sfContext* context, sfBool active)
bool sfContext_setActive(sfContext* context, bool active)
{
CSFML_CALL_RETURN(context, setActive(active == sfTrue), false)
CSFML_CALL_RETURN(context, setActive(active), false)
}
@@ -80,7 +80,7 @@ sfContextSettings sfContext_getSettings(const sfContext* context)
////////////////////////////////////////////////////////////
sfUint64 sfContext_getActiveContextId()
uint64_t sfContext_getActiveContextId()
{
return sf::Context::getActiveContextId();
}
+3 -3
View File
@@ -38,7 +38,7 @@ namespace priv
////////////////////////////////////////////////////////////
inline sfContextSettings sfContextSettings_null()
{
sfContextSettings settings = {0, 0, 0, 0, 0, 0, sfFalse};
sfContextSettings settings = {0, 0, 0, 0, 0, 0, false};
return settings;
}
@@ -54,7 +54,7 @@ namespace priv
to.majorVersion = from.majorVersion;
to.minorVersion = from.minorVersion;
to.attributeFlags = from.attributeFlags;
to.sRgbCapable = from.sRgbCapable ? sfTrue : sfFalse;
to.sRgbCapable = from.sRgbCapable;
}
////////////////////////////////////////////////////////////
@@ -68,7 +68,7 @@ namespace priv
to.majorVersion = from.majorVersion;
to.minorVersion = from.minorVersion;
to.attributeFlags = from.attributeFlags;
to.sRgbCapable = from.sRgbCapable == sfTrue;
to.sRgbCapable = from.sRgbCapable;
}
}
+1 -1
View File
@@ -31,7 +31,7 @@
////////////////////////////////////////////////////////////
sfCursor* sfCursor_createFromPixels(const sfUint8* pixels, sfVector2u size, sfVector2u hotspot)
sfCursor* sfCursor_createFromPixels(const uint8_t* pixels, sfVector2u size, sfVector2u hotspot)
{
sfCursor* cursor = new sfCursor;
+6 -6
View File
@@ -31,9 +31,9 @@
////////////////////////////////////////////////////////////
sfBool sfJoystick_isConnected(unsigned int joystick)
bool sfJoystick_isConnected(unsigned int joystick)
{
return sf::Joystick::isConnected(joystick) ? sfTrue : sfFalse;
return sf::Joystick::isConnected(joystick);
}
@@ -45,16 +45,16 @@ unsigned int sfJoystick_getButtonCount(unsigned int joystick)
////////////////////////////////////////////////////////////
sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis)
bool 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));
}
////////////////////////////////////////////////////////////
sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button)
bool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button)
{
return sf::Joystick::isButtonPressed(joystick, button) ? sfTrue : sfFalse;
return sf::Joystick::isButtonPressed(joystick, button);
}
+4 -4
View File
@@ -34,14 +34,14 @@
////////////////////////////////////////////////////////////
sfBool sfKeyboard_isKeyPressed(sfKeyCode key)
bool sfKeyboard_isKeyPressed(sfKeyCode key)
{
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Key>(key));
}
////////////////////////////////////////////////////////////
sfBool sfKeyboard_isScancodePressed(sfScancode code)
bool sfKeyboard_isScancodePressed(sfScancode code)
{
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Scancode>(code));
}
@@ -69,7 +69,7 @@ const char* sfKeyboard_getDescription(sfScancode code)
////////////////////////////////////////////////////////////
void sfKeyboard_setVirtualKeyboardVisible(sfBool visible)
void sfKeyboard_setVirtualKeyboardVisible(bool visible)
{
sf::Keyboard::setVirtualKeyboardVisible(visible == sfTrue);
sf::Keyboard::setVirtualKeyboardVisible(visible);
}
+2 -2
View File
@@ -32,9 +32,9 @@
////////////////////////////////////////////////////////////
sfBool sfMouse_isButtonPressed(sfMouseButton button)
bool 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));
}
+3 -3
View File
@@ -31,15 +31,15 @@
////////////////////////////////////////////////////////////
sfBool sfSensor_isAvailable(sfSensorType sensor)
bool sfSensor_isAvailable(sfSensorType sensor)
{
return sf::Sensor::isAvailable(static_cast<sf::Sensor::Type>(sensor));
}
////////////////////////////////////////////////////////////
void sfSensor_setEnabled(sfSensorType sensor, sfBool enabled)
void sfSensor_setEnabled(sfSensorType sensor, bool enabled)
{
sf::Sensor::setEnabled(static_cast<sf::Sensor::Type>(sensor), enabled == sfTrue);
sf::Sensor::setEnabled(static_cast<sf::Sensor::Type>(sensor), enabled);
}
////////////////////////////////////////////////////////////
+1 -2
View File
@@ -32,7 +32,7 @@
////////////////////////////////////////////////////////////
sfBool sfTouch_isDown(unsigned int finger)
bool sfTouch_isDown(unsigned int finger)
{
return sf::Touch::isDown(finger);
}
@@ -50,4 +50,3 @@ sfVector2i sfTouch_getPosition(unsigned int finger, const sfWindow* relativeTo)
sfVector2i position = {sfmlPosition.x, sfmlPosition.y};
return position;
}
+2 -2
View File
@@ -70,8 +70,8 @@ const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count)
////////////////////////////////////////////////////////////
sfBool sfVideoMode_isValid(sfVideoMode mode)
bool sfVideoMode_isValid(sfVideoMode mode)
{
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
return videoMode.isValid() ? sfTrue : sfFalse;
return videoMode.isValid();
}
+1 -1
View File
@@ -34,7 +34,7 @@
////////////////////////////////////////////////////////////
sfBool sfVulkan_isAvailable(sfBool requireGraphics)
bool sfVulkan_isAvailable(bool requireGraphics)
{
return sf::Vulkan::isAvailable(requireGraphics);
}
+32 -32
View File
@@ -34,7 +34,7 @@
////////////////////////////////////////////////////////////
sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings)
sfWindow* sfWindow_create(sfVideoMode mode, const char* title, uint32_t style, const sfContextSettings* settings)
{
// Convert video mode
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
@@ -54,7 +54,7 @@ sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, c
}
////////////////////////////////////////////////////////////
sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings)
sfWindow* sfWindow_createUnicode(sfVideoMode mode, const uint32_t* title, uint32_t style, const sfContextSettings* settings)
{
// Convert video mode
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
@@ -106,9 +106,9 @@ void sfWindow_close(sfWindow* window)
////////////////////////////////////////////////////////////
sfBool sfWindow_isOpen(const sfWindow* window)
bool sfWindow_isOpen(const sfWindow* window)
{
CSFML_CALL_RETURN(window, isOpen(), sfFalse);
CSFML_CALL_RETURN(window, isOpen(), false);
}
@@ -126,44 +126,44 @@ sfContextSettings sfWindow_getSettings(const sfWindow* window)
////////////////////////////////////////////////////////////
sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event)
bool sfWindow_pollEvent(sfWindow* window, sfEvent* event)
{
CSFML_CHECK_RETURN(window, sfFalse);
CSFML_CHECK_RETURN(event, sfFalse);
CSFML_CHECK_RETURN(window, false);
CSFML_CHECK_RETURN(event, false);
// Get the event
sf::Event sfmlEvent;
sfBool ret = window->This.pollEvent(sfmlEvent);
bool ret = window->This.pollEvent(sfmlEvent);
// No event, return
if (!ret)
return sfFalse;
return false;
// Convert the sf::Event event to a sfEvent
convertEvent(sfmlEvent, event);
return sfTrue;
return true;
}
////////////////////////////////////////////////////////////
sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event)
bool sfWindow_waitEvent(sfWindow* window, sfEvent* event)
{
CSFML_CHECK_RETURN(window, sfFalse);
CSFML_CHECK_RETURN(event, sfFalse);
CSFML_CHECK_RETURN(window, false);
CSFML_CHECK_RETURN(event, false);
// Get the event
sf::Event sfmlEvent;
sfBool ret = window->This.waitEvent(sfmlEvent);
bool ret = window->This.waitEvent(sfmlEvent);
// Error, return
if (!ret)
return sfFalse;
return false;
// Convert the sf::Event event to a sfEvent
convertEvent(sfmlEvent, event);
return sfTrue;
return true;
}
@@ -217,37 +217,37 @@ void sfWindow_setTitle(sfWindow* window, const char* title)
////////////////////////////////////////////////////////////
void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32* title)
void sfWindow_setUnicodeTitle(sfWindow* window, const uint32_t* 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 uint8_t* pixels)
{
CSFML_CALL(window, setIcon(width, height, pixels));
}
////////////////////////////////////////////////////////////
void sfWindow_setVisible(sfWindow* window, sfBool visible)
void sfWindow_setVisible(sfWindow* window, bool visible)
{
CSFML_CALL(window, setVisible(visible == sfTrue));
CSFML_CALL(window, setVisible(visible));
}
////////////////////////////////////////////////////////////
void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible)
void sfWindow_setMouseCursorVisible(sfWindow* window, bool visible)
{
CSFML_CALL(window, setMouseCursorVisible(visible == sfTrue));
CSFML_CALL(window, setMouseCursorVisible(visible));
}
////////////////////////////////////////////////////////////
void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed)
void sfWindow_setMouseCursorGrabbed(sfWindow* window, bool grabbed)
{
CSFML_CALL(window, setMouseCursorGrabbed(grabbed == sfTrue));
CSFML_CALL(window, setMouseCursorGrabbed(grabbed));
}
@@ -260,23 +260,23 @@ void sfWindow_setMouseCursor(sfWindow* window, const sfCursor* cursor)
}
////////////////////////////////////////////////////////////
void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled)
void sfWindow_setVerticalSyncEnabled(sfWindow* window, bool enabled)
{
CSFML_CALL(window, setVerticalSyncEnabled(enabled == sfTrue));
CSFML_CALL(window, setVerticalSyncEnabled(enabled));
}
////////////////////////////////////////////////////////////
void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled)
void sfWindow_setKeyRepeatEnabled(sfWindow* window, bool enabled)
{
CSFML_CALL(window, setKeyRepeatEnabled(enabled == sfTrue));
CSFML_CALL(window, setKeyRepeatEnabled(enabled));
}
////////////////////////////////////////////////////////////
sfBool sfWindow_setActive(sfWindow* window, sfBool active)
bool sfWindow_setActive(sfWindow* window, bool active)
{
CSFML_CALL_RETURN(window, setActive(active == sfTrue), sfFalse);
CSFML_CALL_RETURN(window, setActive(active), false);
}
@@ -288,9 +288,9 @@ void sfWindow_requestFocus(sfWindow* window)
////////////////////////////////////////////////////////////
sfBool sfWindow_hasFocus(const sfWindow* window)
bool sfWindow_hasFocus(const sfWindow* window)
{
CSFML_CALL_RETURN(window, hasFocus(), sfFalse);
CSFML_CALL_RETURN(window, hasFocus(), false);
}
+32 -32
View File
@@ -33,7 +33,7 @@
////////////////////////////////////////////////////////////
sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, sfUint32 style)
sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, uint32_t style)
{
// Convert video mode
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
@@ -47,7 +47,7 @@ sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, sfUint32
////////////////////////////////////////////////////////////
sfWindowBase* sfWindowBase_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style)
sfWindowBase* sfWindowBase_createUnicode(sfVideoMode mode, const uint32_t* title, uint32_t style)
{
// Convert video mode
sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel);
@@ -86,51 +86,51 @@ void sfWindowBase_close(sfWindowBase* windowBase)
////////////////////////////////////////////////////////////
sfBool sfWindowBase_isOpen(const sfWindowBase* windowBase)
bool sfWindowBase_isOpen(const sfWindowBase* windowBase)
{
CSFML_CALL_RETURN(windowBase, isOpen(), sfFalse);
CSFML_CALL_RETURN(windowBase, isOpen(), false);
}
////////////////////////////////////////////////////////////
sfBool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent* event)
bool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent* event)
{
CSFML_CHECK_RETURN(windowBase, sfFalse);
CSFML_CHECK_RETURN(event, sfFalse);
CSFML_CHECK_RETURN(windowBase, false);
CSFML_CHECK_RETURN(event, false);
// Get the event
sf::Event sfmlEvent;
sfBool ret = windowBase->This.pollEvent(sfmlEvent);
bool ret = windowBase->This.pollEvent(sfmlEvent);
// No event, return
if (!ret)
return sfFalse;
return false;
// Convert the sf::Event event to a sfEvent
convertEvent(sfmlEvent, event);
return sfTrue;
return true;
}
////////////////////////////////////////////////////////////
sfBool sfWindowBase_waitEvent(sfWindowBase* windowBase, sfEvent* event)
bool sfWindowBase_waitEvent(sfWindowBase* windowBase, sfEvent* event)
{
CSFML_CHECK_RETURN(windowBase, sfFalse);
CSFML_CHECK_RETURN(event, sfFalse);
CSFML_CHECK_RETURN(windowBase, false);
CSFML_CHECK_RETURN(event, false);
// Get the event
sf::Event sfmlEvent;
sfBool ret = windowBase->This.waitEvent(sfmlEvent);
bool ret = windowBase->This.waitEvent(sfmlEvent);
// Error, return
if (!ret)
return sfFalse;
return false;
// Convert the sf::Event event to a sfEvent
convertEvent(sfmlEvent, event);
return sfTrue;
return true;
}
@@ -184,37 +184,37 @@ void sfWindowBase_setTitle(sfWindowBase* windowBase, const char* title)
////////////////////////////////////////////////////////////
void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, const sfUint32* title)
void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, const uint32_t* title)
{
CSFML_CALL(windowBase, setTitle(title));
}
////////////////////////////////////////////////////////////
void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const sfUint8* pixels)
void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const uint8_t* pixels)
{
CSFML_CALL(windowBase, setIcon(width, height, pixels));
}
////////////////////////////////////////////////////////////
void sfWindowBase_setVisible(sfWindowBase* windowBase, sfBool visible)
void sfWindowBase_setVisible(sfWindowBase* windowBase, bool visible)
{
CSFML_CALL(windowBase, setVisible(visible == sfTrue));
CSFML_CALL(windowBase, setVisible(visible));
}
////////////////////////////////////////////////////////////
void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBase, sfBool visible)
void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBase, bool visible)
{
CSFML_CALL(windowBase, setMouseCursorVisible(visible == sfTrue));
CSFML_CALL(windowBase, setMouseCursorVisible(visible));
}
////////////////////////////////////////////////////////////
void sfWindowBase_setMouseCursorGrabbed(sfWindowBase* windowBase, sfBool grabbed)
void sfWindowBase_setMouseCursorGrabbed(sfWindowBase* windowBase, bool grabbed)
{
CSFML_CALL(windowBase, setMouseCursorGrabbed(grabbed == sfTrue));
CSFML_CALL(windowBase, setMouseCursorGrabbed(grabbed));
}
@@ -228,9 +228,9 @@ void sfWindowBase_setMouseCursor(sfWindowBase* windowBase, const sfCursor* curso
////////////////////////////////////////////////////////////
void sfWindowBase_setKeyRepeatEnabled(sfWindowBase* windowBase, sfBool enabled)
void sfWindowBase_setKeyRepeatEnabled(sfWindowBase* windowBase, bool enabled)
{
CSFML_CALL(windowBase, setKeyRepeatEnabled(enabled == sfTrue));
CSFML_CALL(windowBase, setKeyRepeatEnabled(enabled));
}
@@ -249,9 +249,9 @@ void sfWindowBase_requestFocus(sfWindowBase* windowBase)
////////////////////////////////////////////////////////////
sfBool sfWindowBase_hasFocus(const sfWindowBase* windowBase)
bool sfWindowBase_hasFocus(const sfWindowBase* windowBase)
{
CSFML_CALL_RETURN(windowBase, hasFocus(), sfFalse);
CSFML_CALL_RETURN(windowBase, hasFocus(), false);
}
@@ -264,9 +264,9 @@ sfWindowHandle sfWindowBase_getSystemHandle(const sfWindowBase* windowBase)
}
////////////////////////////////////////////////////////////
sfBool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator)
bool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator)
{
CSFML_CHECK_RETURN(instance, sfFalse);
CSFML_CHECK_RETURN(surface, sfFalse);
CSFML_CALL_RETURN(windowBase, createVulkanSurface(*instance, *surface, allocator), sfFalse);
CSFML_CHECK_RETURN(instance, false);
CSFML_CHECK_RETURN(surface, false);
CSFML_CALL_RETURN(windowBase, createVulkanSurface(*instance, *surface, allocator), false);
}