mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
Use C standard library utilities for booleans and fixed-width ints
This commit is contained in:
1 parent
46bc9a7ed8
commit
a51c22a7a3
97 files changed
+670
-707
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user