Run clang-format

This commit is contained in:
Chris Thrasher committed 2024-09-01 11:32:18 -06:00
1 parent 42aec92642
commit 54d28325b9
156 files changed
+1045 -777

No files matched your search

+3 -3
View File
@@ -6,8 +6,8 @@
int main(void)
{
// Create the main window
const sfVideoMode mode = {{800, 600}, 32};
sfRenderWindow* window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, sfWindowed, NULL);
const sfVideoMode mode = {{800, 600}, 32};
sfRenderWindow* window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, sfWindowed, NULL);
if (!window)
return EXIT_FAILURE;
@@ -18,7 +18,7 @@ int main(void)
sfRenderWindow_destroy(window);
return EXIT_FAILURE;
}
sfSprite* sprite = sfSprite_create(texture);
sfSprite* sprite = sfSprite_create(texture);
const sfVector2f spritePosition = {200, 200};
sfSprite_setPosition(sprite, spritePosition);
+1 -1
View File
@@ -28,7 +28,6 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System.h>
#include <CSFML/Audio/Listener.h>
#include <CSFML/Audio/Music.h>
#include <CSFML/Audio/Sound.h>
@@ -37,3 +36,4 @@
#include <CSFML/Audio/SoundRecorder.h>
#include <CSFML/Audio/SoundStatus.h>
#include <CSFML/Audio/SoundStream.h>
#include <CSFML/System.h>
+2 -2
View File
@@ -35,10 +35,10 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_AUDIO_EXPORTS)
#define CSFML_AUDIO_API CSFML_API_EXPORT
#define CSFML_AUDIO_API CSFML_API_EXPORT
#else
#define CSFML_AUDIO_API CSFML_API_IMPORT
#define CSFML_AUDIO_API CSFML_API_IMPORT
#endif
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/System/Vector3.h>
+2
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/Audio/SoundStatus.h>
#include <CSFML/Audio/Types.h>
#include <CSFML/System/InputStream.h>
#include <CSFML/System/Time.h>
#include <CSFML/System/Vector3.h>
#include <stddef.h>
+2 -1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/Audio/SoundStatus.h>
#include <CSFML/Audio/Types.h>
#include <CSFML/System/Time.h>
@@ -36,7 +37,7 @@
////////////////////////////////////////////////////////////
/// \brief Create a new sound
///
///
/// \param soundBuffer Sound buffer containing the audio data to play with the sound
///
/// \return A new sfSound object
+10 -7
View File
@@ -28,10 +28,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/Audio/Types.h>
#include <CSFML/Audio/SoundChannel.h>
#include <CSFML/Audio/Types.h>
#include <CSFML/System/InputStream.h>
#include <CSFML/System/Time.h>
#include <stddef.h>
@@ -94,12 +96,13 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const int16_t* samples,
uint64_t sampleCount,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(
const int16_t* samples,
uint64_t sampleCount,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer by copying an existing one
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/Audio/Types.h>
+4 -2
View File
@@ -28,14 +28,16 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/Audio/Types.h>
#include <CSFML/System/Time.h>
#include <stddef.h>
typedef bool (*sfSoundRecorderStartCallback)(void*); ///< Type of the callback used when starting 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
typedef void (*sfSoundRecorderStopCallback)(void*); ///< Type of the callback used when stopping a capture
////////////////////////////////////////////////////////////
+12 -9
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Export.h>
#include <CSFML/Audio/SoundChannel.h>
#include <CSFML/Audio/SoundStatus.h>
#include <CSFML/Audio/Types.h>
#include <CSFML/Audio/SoundChannel.h>
#include <CSFML/System/Time.h>
#include <CSFML/System/Vector3.h>
#include <stddef.h>
@@ -47,7 +49,7 @@ typedef struct
} sfSoundStreamChunk;
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
typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< Type of the callback used to seek in a sound stream
////////////////////////////////////////////////////////////
@@ -64,13 +66,14 @@ typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< T
/// \return A new sfSoundStream object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback onSeek,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize,
void* userData);
CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(
sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback onSeek,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize,
void* userData);
////////////////////////////////////////////////////////////
/// \brief Destroy a sound stream
+5 -5
View File
@@ -24,9 +24,9 @@
#pragma once
typedef struct sfMusic sfMusic;
typedef struct sfSound sfSound;
typedef struct sfSoundBuffer sfSoundBuffer;
typedef struct sfMusic sfMusic;
typedef struct sfSound sfSound;
typedef struct sfSoundBuffer sfSoundBuffer;
typedef struct sfSoundBufferRecorder sfSoundBufferRecorder;
typedef struct sfSoundRecorder sfSoundRecorder;
typedef struct sfSoundStream sfSoundStream;
typedef struct sfSoundRecorder sfSoundRecorder;
typedef struct sfSoundStream sfSoundStream;
+34 -34
View File
@@ -28,8 +28,8 @@
// Headers
////////////////////////////////////////////////////////////
#include <stdint.h>
#include <stdbool.h>
#include <stdint.h>
////////////////////////////////////////////////////////////
@@ -44,9 +44,9 @@
// Check if we need to mark functions as extern "C"
////////////////////////////////////////////////////////////
#ifdef __cplusplus
#define CSFML_EXTERN_C extern "C"
#define CSFML_EXTERN_C extern "C"
#else
#define CSFML_EXTERN_C extern
#define CSFML_EXTERN_C extern
#endif
@@ -55,28 +55,28 @@
////////////////////////////////////////////////////////////
#if defined(_WIN32) || defined(__WIN32__)
// Windows
#define CSFML_SYSTEM_WINDOWS
// Windows
#define CSFML_SYSTEM_WINDOWS
#elif defined(linux) || defined(__linux)
// Linux
#define CSFML_SYSTEM_LINUX
// Linux
#define CSFML_SYSTEM_LINUX
#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
// MacOS
#define CSFML_SYSTEM_MACOS
// MacOS
#define CSFML_SYSTEM_MACOS
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
// FreeBSD
#define CSFML_SYSTEM_FREEBSD
// FreeBSD
#define CSFML_SYSTEM_FREEBSD
#else
// Unsupported system
#error This operating system is not supported by SFML library
// Unsupported system
#error This operating system is not supported by SFML library
#endif
@@ -86,21 +86,21 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_SYSTEM_WINDOWS)
// Windows compilers need specific (and different) keywords for export and import
#define CSFML_API_EXPORT extern "C" __declspec(dllexport)
#define CSFML_API_IMPORT CSFML_EXTERN_C __declspec(dllimport)
// Windows compilers need specific (and different) keywords for export and import
#define CSFML_API_EXPORT extern "C" __declspec(dllexport)
#define CSFML_API_IMPORT CSFML_EXTERN_C __declspec(dllimport)
// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
#ifdef _MSC_VER
// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#pragma warning(disable : 4251)
#endif
#endif
#else // Linux, FreeBSD, Mac OS X
#define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default")))
#define CSFML_API_IMPORT CSFML_EXTERN_C __attribute__ ((__visibility__ ("default")))
#define CSFML_API_EXPORT extern "C" __attribute__((__visibility__("default")))
#define CSFML_API_IMPORT CSFML_EXTERN_C __attribute__((__visibility__("default")))
#endif
@@ -117,27 +117,27 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_NO_DEPRECATED_WARNINGS)
// User explicitly requests to disable deprecation warnings
#define CSFML_DEPRECATED
// User explicitly requests to disable deprecation warnings
#define CSFML_DEPRECATED
#elif defined(_MSC_VER)
// Microsoft C++ compiler
// Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to
// trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified.
#define CSFML_DEPRECATED __declspec(deprecated)
// Microsoft C++ compiler
// Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to
// trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified.
#define CSFML_DEPRECATED __declspec(deprecated)
#elif defined(__GNUC__)
// g++ and Clang
#define CSFML_DEPRECATED __attribute__ ((deprecated))
// g++ and Clang
#define CSFML_DEPRECATED __attribute__((deprecated))
#else
// Other compilers are not supported, leave class or function as-is.
// With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma.
#pragma message("CSFML_DEPRECATED is not supported for your compiler, please contact the CSFML team")
#define CSFML_DEPRECATED
// Other compilers are not supported, leave class or function as-is.
// With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma.
#pragma message("CSFML_DEPRECATED is not supported for your compiler, please contact the CSFML team")
#define CSFML_DEPRECATED
#endif
+4 -4
View File
@@ -58,12 +58,12 @@
////////////////////////////////////////////////////////////
#if defined(SFML_SYSTEM_WINDOWS)
#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \
CSFML_EXTERN_C __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \
CSFML_EXTERN_C __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \
CSFML_EXTERN_C __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \
CSFML_EXTERN_C __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
#else
#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE
#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE
#endif
+1 -1
View File
@@ -28,7 +28,6 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window.h>
#include <CSFML/Graphics/BlendMode.h>
#include <CSFML/Graphics/CircleShape.h>
#include <CSFML/Graphics/Color.h>
@@ -54,3 +53,4 @@
#include <CSFML/Graphics/VertexArray.h>
#include <CSFML/Graphics/VertexBuffer.h>
#include <CSFML/Graphics/View.h>
#include <CSFML/Window.h>
+6 -6
View File
@@ -69,12 +69,12 @@ typedef enum
////////////////////////////////////////////////////////////
typedef struct
{
sfBlendFactor colorSrcFactor; ///< Source blending factor for the color channels
sfBlendFactor colorDstFactor; ///< Destination blending factor for the color channels
sfBlendEquation colorEquation; ///< Blending equation for the color channels
sfBlendFactor alphaSrcFactor; ///< Source blending factor for the alpha channel
sfBlendFactor alphaDstFactor; ///< Destination blending factor for the alpha channel
sfBlendEquation alphaEquation; ///< Blending equation for the alpha channel
sfBlendFactor colorSrcFactor; ///< Source blending factor for the color channels
sfBlendFactor colorDstFactor; ///< Destination blending factor for the color channels
sfBlendEquation colorEquation; ///< Blending equation for the color channels
sfBlendFactor alphaSrcFactor; ///< Source blending factor for the alpha channel
sfBlendFactor alphaDstFactor; ///< Destination blending factor for the alpha channel
sfBlendEquation alphaEquation; ///< Blending equation for the alpha channel
} sfBlendMode;
+2
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
+2
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
+2 -2
View File
@@ -35,10 +35,10 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_GRAPHICS_EXPORTS)
#define CSFML_GRAPHICS_API CSFML_API_EXPORT
#define CSFML_GRAPHICS_API CSFML_API_EXPORT
#else
#define CSFML_GRAPHICS_API CSFML_API_IMPORT
#define CSFML_GRAPHICS_API CSFML_API_IMPORT
#endif
+4 -1
View File
@@ -28,10 +28,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/FontInfo.h>
#include <CSFML/Graphics/Glyph.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/InputStream.h>
#include <stddef.h>
@@ -96,7 +98,8 @@ CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
/// \return The corresponding glyph
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness);
CSFML_GRAPHICS_API sfGlyph
sfFont_getGlyph(const sfFont* font, uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness);
////////////////////////////////////////////////////////////
/// \brief Determine if this font has a glyph representing the requested code point
+1 -1
View File
@@ -27,8 +27,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/System/Vector3.h>
+3 -1
View File
@@ -28,12 +28,14 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Buffer.h>
#include <CSFML/System/InputStream.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
@@ -219,7 +221,7 @@ CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor colo
/// \param dest Coordinates of the destination position
/// \param sourceRect Sub-rectangle of the source image to copy
/// \param applyAlpha Should the copy take in account the source transparency?
///
///
/// \return True if the operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
+1 -1
View File
@@ -45,5 +45,5 @@ typedef enum
sfLineStrip, ///< List of connected lines, a point uses the previous point to form a line
sfTriangles, ///< List of individual triangles
sfTriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle
sfTriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle
sfTriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle
} sfPrimitiveType;
+2
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/BlendMode.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
+45 -19
View File
@@ -28,14 +28,16 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/PrimitiveType.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/RenderStates.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/Vertex.h>
#include <CSFML/Window/Window.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Window.h>
#include <stddef.h>
@@ -171,7 +173,8 @@ CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture*
/// \return The converted point, in "world" units
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
CSFML_GRAPHICS_API sfVector2f
sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Convert a point from world coordinates to texture coordinates
@@ -197,7 +200,8 @@ CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTex
/// \return The converted point, in target coordinates (pixels)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
CSFML_GRAPHICS_API sfVector2i
sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Draw a drawable object to the render-target
@@ -207,14 +211,30 @@ CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTex
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, const sfVertexBuffer* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture,
const sfSprite* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture,
const sfText* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture,
const sfShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture,
const sfCircleShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture,
const sfConvexShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture,
const sfRectangleShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture,
const sfVertexArray* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture,
const sfVertexBuffer* object,
const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Draw primitives defined by a vertex buffer.
@@ -226,9 +246,12 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* render
/// \param states Render states to use for drawing
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* renderTexture,
const sfVertexBuffer* object, size_t firstVertex,
size_t vertexCount, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange(
sfRenderTexture* renderTexture,
const sfVertexBuffer* object,
size_t firstVertex,
size_t vertexCount,
const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Draw primitives defined by an array of vertices to a render texture
@@ -240,9 +263,12 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* r
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
const sfVertex* vertices, size_t vertexCount,
sfPrimitiveType type, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(
sfRenderTexture* renderTexture,
const sfVertex* vertices,
size_t vertexCount,
sfPrimitiveType type,
const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Save the current OpenGL render states and matrices
+57 -21
View File
@@ -28,17 +28,19 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/PrimitiveType.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/RenderStates.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/Vertex.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Event.h>
#include <CSFML/Window/VideoMode.h>
#include <CSFML/Window/WindowHandle.h>
#include <CSFML/Window/Window.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/WindowHandle.h>
#include <stddef.h>
@@ -51,7 +53,12 @@
/// \param settings Creation settings (pass NULL to use default values)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, uint32_t style, sfWindowState state, const sfContextSettings* settings);
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(
sfVideoMode mode,
const char* title,
uint32_t style,
sfWindowState state,
const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a new render window (with a UTF-32 title)
@@ -62,7 +69,12 @@ 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 sfChar32* title, uint32_t style, sfWindowState state, const sfContextSettings* settings);
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(
sfVideoMode mode,
const sfChar32* title,
uint32_t style,
sfWindowState state,
const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a render window from an existing control
@@ -429,7 +441,8 @@ CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* re
/// \return The converted point, in "world" units
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
CSFML_GRAPHICS_API sfVector2f
sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Convert a point from world coordinates to window coordinates
@@ -455,7 +468,8 @@ CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWind
/// \return The converted point, in target coordinates (pixels)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
CSFML_GRAPHICS_API sfVector2i
sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Draw a drawable object to the render-target
@@ -465,14 +479,26 @@ CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWind
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow,
const sfSprite* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVertexBuffer* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow,
const sfCircleShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow,
const sfConvexShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow,
const sfRectangleShape* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow,
const sfVertexArray* object,
const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow,
const sfVertexBuffer* object,
const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Draw primitives defined by a vertex buffer.
@@ -484,9 +510,12 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWi
/// \param states Render states to use for drawing
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* renderWindow,
const sfVertexBuffer* object, size_t firstVertex,
size_t vertexCount, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange(
sfRenderWindow* renderWindow,
const sfVertexBuffer* object,
size_t firstVertex,
size_t vertexCount,
const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Draw primitives defined by an array of vertices to a render window
@@ -498,9 +527,12 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* ren
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
const sfVertex* vertices, size_t vertexCount,
sfPrimitiveType type, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(
sfRenderWindow* renderWindow,
const sfVertex* vertices,
size_t vertexCount,
sfPrimitiveType type,
const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Save the current OpenGL render states and matrices
@@ -600,4 +632,8 @@ CSFML_GRAPHICS_API sfVector2i sfTouch_getPositionRenderWindow(unsigned int finge
/// \return True if surface creation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API bool sfRenderWindow_createVulkanSurface(sfRenderWindow* renderWindow, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
CSFML_GRAPHICS_API bool sfRenderWindow_createVulkanSurface(
sfRenderWindow* renderWindow,
const VkInstance* instance,
VkSurfaceKHR* surface,
const VkAllocationCallbacks* allocator);
+11 -3
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Glsl.h>
#include <CSFML/Graphics/Transform.h>
@@ -35,6 +36,7 @@
#include <CSFML/System/InputStream.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/System/Vector3.h>
#include <stddef.h>
@@ -56,7 +58,9 @@
/// \return A new sfShader object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename);
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename,
const char* geometryShaderFilename,
const char* fragmentShaderFilename);
////////////////////////////////////////////////////////////
/// \brief Load the vertex, geometry and fragment shaders from source code in memory
@@ -76,7 +80,9 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFil
/// \return A new sfShader object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader);
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader,
const char* geometryShader,
const char* fragmentShader);
////////////////////////////////////////////////////////////
/// \brief Load the vertex, geometry and fragment shaders from custom streams
@@ -96,7 +102,9 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader,
/// \return A new sfShader object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream);
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream,
sfInputStream* geometryShaderStream,
sfInputStream* fragmentShaderStream);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing shader
+5 -3
View File
@@ -28,15 +28,17 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
typedef size_t (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape
typedef size_t (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape
typedef sfVector2f (*sfShapeGetPointCallback)(size_t, void*); ///< Type of the callback used to get a point of a shape
////////////////////////////////////////////////////////////
@@ -50,8 +52,8 @@ typedef sfVector2f (*sfShapeGetPointCallback)(size_t, void*); ///< Type of the c
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount,
sfShapeGetPointCallback getPoint,
void* userData);
sfShapeGetPointCallback getPoint,
void* userData);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing shape
+2 -1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/BlendMode.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
@@ -38,7 +39,7 @@
////////////////////////////////////////////////////////////
/// \brief Create a new sprite
///
///
/// \param texture Source texture
///
/// \return A new sfSprite object, or NULL if it failed
+6 -4
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
@@ -51,7 +53,7 @@ typedef enum
////////////////////////////////////////////////////////////
/// \brief Create a new text
///
///
/// \param font Font used to draw the string
///
/// \return A new sfText object, or NULL if it failed
@@ -277,7 +279,7 @@ CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font);
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size);
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/// \brief Set the line spacing factor
///
/// The default spacing between lines is defined by the font.
@@ -376,7 +378,7 @@ CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the string of a text (returns a unicode string)
///
///
/// \param text Text object
///
/// \return String as UTF-32
+3 -1
View File
@@ -28,11 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Window/Types.h>
#include <CSFML/System/InputStream.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Types.h>
#include <stddef.h>
////////////////////////////////////////////////////////////
+3 -4
View File
@@ -28,12 +28,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
////////////////////////////////////////////////////////////
/// \brief Encapsulate a 3x3 transform matrix
///
@@ -66,9 +66,8 @@ CSFML_GRAPHICS_API const sfTransform sfTransform_Identity;
/// \return A new sfTransform object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTransform sfTransform_fromMatrix(float a00, float a01, float a02,
float a10, float a11, float a12,
float a20, float a21, float a22);
CSFML_GRAPHICS_API sfTransform
sfTransform_fromMatrix(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22);
////////////////////////////////////////////////////////////
/// \brief Return the 4x4 matrix of a transform
+2 -1
View File
@@ -28,8 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/Transform.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
+15 -15
View File
@@ -25,19 +25,19 @@
#pragma once
typedef struct sfCircleShape sfCircleShape;
typedef struct sfConvexShape sfConvexShape;
typedef struct sfFont sfFont;
typedef struct sfImage sfImage;
typedef struct sfShader sfShader;
typedef struct sfCircleShape sfCircleShape;
typedef struct sfConvexShape sfConvexShape;
typedef struct sfFont sfFont;
typedef struct sfImage sfImage;
typedef struct sfShader sfShader;
typedef struct sfRectangleShape sfRectangleShape;
typedef struct sfRenderTexture sfRenderTexture;
typedef struct sfRenderWindow sfRenderWindow;
typedef struct sfShape sfShape;
typedef struct sfSprite sfSprite;
typedef struct sfText sfText;
typedef struct sfTexture sfTexture;
typedef struct sfTransformable sfTransformable;
typedef struct sfVertexArray sfVertexArray;
typedef struct sfVertexBuffer sfVertexBuffer;
typedef struct sfView sfView;
typedef struct sfRenderTexture sfRenderTexture;
typedef struct sfRenderWindow sfRenderWindow;
typedef struct sfShape sfShape;
typedef struct sfSprite sfSprite;
typedef struct sfText sfText;
typedef struct sfTexture sfTexture;
typedef struct sfTransformable sfTransformable;
typedef struct sfVertexArray sfVertexArray;
typedef struct sfVertexBuffer sfVertexBuffer;
typedef struct sfView sfView;
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Color.h>
#include <CSFML/System/Vector2.h>
+2
View File
@@ -28,10 +28,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/PrimitiveType.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/Vertex.h>
#include <stddef.h>
+6 -1
View File
@@ -28,9 +28,11 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/PrimitiveType.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/Graphics/Vertex.h>
#include <stddef.h>
@@ -128,7 +130,10 @@ CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuff
/// \return true if the update was successful
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API bool 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
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Export.h>
#include <CSFML/Graphics/Rect.h>
#include <CSFML/Graphics/Types.h>
#include <CSFML/System/Vector2.h>
+1 -1
View File
@@ -28,7 +28,6 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System.h>
#include <CSFML/Network/Ftp.h>
#include <CSFML/Network/Http.h>
#include <CSFML/Network/IpAddress.h>
@@ -38,3 +37,4 @@
#include <CSFML/Network/TcpListener.h>
#include <CSFML/Network/TcpSocket.h>
#include <CSFML/Network/UdpSocket.h>
#include <CSFML/System.h>
+2 -2
View File
@@ -35,10 +35,10 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_NETWORK_EXPORTS)
#define CSFML_NETWORK_API CSFML_API_EXPORT
#define CSFML_NETWORK_API CSFML_API_EXPORT
#else
#define CSFML_NETWORK_API CSFML_API_IMPORT
#define CSFML_NETWORK_API CSFML_API_IMPORT
#endif
+18 -11
View File
@@ -28,8 +28,10 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/IpAddress.h>
#include <CSFML/Network/Types.h>
#include <stddef.h>
@@ -59,13 +61,13 @@ typedef enum
sfFtpOpeningDataConnection = 150, ///< File status ok, about to open data connection
// 2xx: the requested action has been successfully completed
sfFtpOk = 200, ///< Command ok
sfFtpPointlessCommand = 202, ///< Command not implemented
sfFtpSystemStatus = 211, ///< System status, or system help reply
sfFtpDirectoryStatus = 212, ///< Directory status
sfFtpFileStatus = 213, ///< File status
sfFtpHelpMessage = 214, ///< Help message
sfFtpSystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document
sfFtpOk = 200, ///< Command ok
sfFtpPointlessCommand = 202, ///< Command not implemented
sfFtpSystemStatus = 211, ///< System status, or system help reply
sfFtpDirectoryStatus = 212, ///< Directory status
sfFtpFileStatus = 213, ///< File status
sfFtpHelpMessage = 214, ///< Help message
sfFtpSystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document
sfFtpServiceReady = 220, ///< Service ready for new user
sfFtpClosingConnection = 221, ///< Service closing control connection
sfFtpDataConnectionOpened = 225, ///< Data connection open, no transfer in progress
@@ -88,7 +90,7 @@ typedef enum
sfFtpTransferAborted = 426, ///< Connection closed, transfer aborted
sfFtpFileActionAborted = 450, ///< Requested file action not taken
sfFtpLocalError = 451, ///< Requested action aborted, local error in processing
sfFtpInsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable
sfFtpInsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable
// 5xx: the command was not accepted and
// the requested action did not take place
@@ -220,7 +222,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirec
///
/// The returned const char* owns the string and must be freed to
/// avoid memory leaks.
///
///
/// \param ftpDirectoryResponse Ftp directory response
///
/// \return Directory name
@@ -234,7 +236,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDir
///
/// The returned const sfChar32* owns the string and must be freed to
/// avoid memory leaks.
///
///
/// \param ftpDirectoryResponse Ftp directory response
///
/// \return Directory name
@@ -521,7 +523,12 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFi
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, bool 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
+7 -6
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/Types.h>
#include <CSFML/System/Time.h>
@@ -53,18 +54,18 @@ typedef enum
typedef enum
{
// 2xx: success
sfHttpOk = 200, ///< Most common code returned when operation was successful
sfHttpCreated = 201, ///< The resource has successfully been created
sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server
sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return
sfHttpResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent
sfHttpOk = 200, ///< Most common code returned when operation was successful
sfHttpCreated = 201, ///< The resource has successfully been created
sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server
sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return
sfHttpResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent
sfHttpPartialContent = 206, ///< The server has sent a part of the resource, as a response to a partial GET request
// 3xx: redirection
sfHttpMultipleChoices = 300, ///< The requested page can be accessed from several locations
sfHttpMovedPermanently = 301, ///< The requested page has permanently moved to a new location
sfHttpMovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
sfHttpNotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
sfHttpNotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
// 4xx: client error
sfHttpBadRequest = 400, ///< The server couldn't understand the request (syntax error)
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/System/Time.h>
+2
View File
@@ -28,7 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/Types.h>
#include <stddef.h>
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/Types.h>
#include <CSFML/System/Time.h>
+2 -1
View File
@@ -28,8 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/SocketStatus.h>
#include <CSFML/Network/IpAddress.h>
#include <CSFML/Network/SocketStatus.h>
#include <CSFML/Network/Types.h>
+4 -1
View File
@@ -28,10 +28,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/IpAddress.h>
#include <CSFML/Network/SocketStatus.h>
#include <CSFML/Network/Types.h>
#include <CSFML/System/Time.h>
#include <stddef.h>
@@ -133,7 +135,8 @@ CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* so
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout);
CSFML_NETWORK_API sfSocketStatus
sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout);
////////////////////////////////////////////////////////////
/// \brief Disconnect a TCP socket from its remote peer
+11 -11
View File
@@ -26,14 +26,14 @@
typedef struct sfFtpDirectoryResponse sfFtpDirectoryResponse;
typedef struct sfFtpListingResponse sfFtpListingResponse;
typedef struct sfFtpResponse sfFtpResponse;
typedef struct sfFtp sfFtp;
typedef struct sfHttpRequest sfHttpRequest;
typedef struct sfHttpResponse sfHttpResponse;
typedef struct sfHttp sfHttp;
typedef struct sfPacket sfPacket;
typedef struct sfSocketSelector sfSocketSelector;
typedef struct sfTcpListener sfTcpListener;
typedef struct sfTcpSocket sfTcpSocket;
typedef struct sfUdpSocket sfUdpSocket;
typedef struct sfFtpListingResponse sfFtpListingResponse;
typedef struct sfFtpResponse sfFtpResponse;
typedef struct sfFtp sfFtp;
typedef struct sfHttpRequest sfHttpRequest;
typedef struct sfHttpResponse sfHttpResponse;
typedef struct sfHttp sfHttp;
typedef struct sfPacket sfPacket;
typedef struct sfSocketSelector sfSocketSelector;
typedef struct sfTcpListener sfTcpListener;
typedef struct sfTcpSocket sfTcpSocket;
typedef struct sfUdpSocket sfUdpSocket;
+15 -4
View File
@@ -28,9 +28,11 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Network/Export.h>
#include <CSFML/Network/IpAddress.h>
#include <CSFML/Network/SocketStatus.h>
#include <CSFML/Network/Types.h>
#include <stddef.h>
@@ -139,7 +141,8 @@ CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket* socket);
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort);
CSFML_NETWORK_API sfSocketStatus
sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort);
////////////////////////////////////////////////////////////
/// \brief Receive raw data from a remote peer with a UDP socket
@@ -161,7 +164,13 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const voi
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(
sfUdpSocket* socket,
void* data,
size_t size,
size_t* received,
sfIpAddress* remoteAddress,
unsigned short* remotePort);
////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to a remote peer with a UDP socket
@@ -178,7 +187,8 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void*
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort);
CSFML_NETWORK_API sfSocketStatus
sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort);
////////////////////////////////////////////////////////////
/// \brief Receive a formatted packet of data from a remote peer with a UDP socket
@@ -193,7 +203,8 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfP
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort);
CSFML_NETWORK_API sfSocketStatus
sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort);
////////////////////////////////////////////////////////////
/// \brief Return the maximum number of bytes that can be
+7 -7
View File
@@ -36,18 +36,18 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_SYSTEM_WINDOWS)
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <windows.h>
#elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD)
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/gl.h>
#include <GL/glu.h>
#elif defined(CSFML_SYSTEM_MACOS)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#endif
+1
View File
@@ -29,6 +29,7 @@
////////////////////////////////////////////////////////////
#include <CSFML/Config.h>
#include <CSFML/System/Buffer.h>
#include <CSFML/System/Clock.h>
#include <CSFML/System/InputStream.h>
+3 -3
View File
@@ -35,11 +35,11 @@
///
/// This function deallocates the memory being pointed to
/// using the free function from the C standard library.
///
///
/// The memory must have been previously allocated using a call
/// to malloc.
///
/// \param ptr Pointer to the memory to deallocate
///
/// \param ptr Pointer to the memory to deallocate
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfFree(void* ptr);
+2
View File
@@ -28,7 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System/Export.h>
#include <CSFML/System/Types.h>
#include <stddef.h>
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System/Export.h>
#include <CSFML/System/Time.h>
#include <CSFML/System/Types.h>
+2 -2
View File
@@ -35,10 +35,10 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_SYSTEM_EXPORTS)
#define CSFML_SYSTEM_API CSFML_API_EXPORT
#define CSFML_SYSTEM_API CSFML_API_EXPORT
#else
#define CSFML_SYSTEM_API CSFML_API_IMPORT
#define CSFML_SYSTEM_API CSFML_API_IMPORT
#endif
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System/Export.h>
#include <stdlib.h>
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System/Export.h>
#include <CSFML/System/Time.h>
+1 -1
View File
@@ -26,4 +26,4 @@
typedef struct sfBuffer sfBuffer;
typedef struct sfClock sfClock;
typedef struct sfClock sfClock;
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Types.h>
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Types.h>
#include <CSFML/Window/Window.h>
+10 -9
View File
@@ -27,8 +27,9 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Export.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Types.h>
@@ -78,14 +79,14 @@ typedef enum
sfCursorSizeRight, ///< Right arrow cursor on Linux, same as SizeHorizontal on other platforms
sfCursorSizeTop, ///< Up arrow cursor on Linux, same as SizeVertical on other platforms
sfCursorSizeBottom, ///< Down arrow cursor on Linux, same as SizeVertical on other platforms
sfCursorSizeTopLeft, ///< Top-left arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms
sfCursorSizeBottomRight, ///< Bottom-right arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms
sfCursorSizeBottomLeft, ///< Bottom-left arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms
sfCursorSizeTopRight, ///< Top-right arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms
sfCursorSizeAll, ///< Combination of SizeHorizontal and SizeVertical
sfCursorCross, ///< Crosshair cursor
sfCursorHelp, ///< Help cursor
sfCursorNotAllowed ///< Action not allowed cursor
sfCursorSizeTopLeft, ///< Top-left arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms
sfCursorSizeBottomRight, ///< Bottom-right arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms
sfCursorSizeBottomLeft, ///< Bottom-left arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms
sfCursorSizeTopRight, ///< Top-right arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms
sfCursorSizeAll, ///< Combination of SizeHorizontal and SizeVertical
sfCursorCross, ///< Crosshair cursor
sfCursorHelp, ///< Help cursor
sfCursorNotAllowed ///< Action not allowed cursor
} sfCursorType;
+2 -1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Joystick.h>
#include <CSFML/Window/Keyboard.h>
#include <CSFML/Window/Mouse.h>
@@ -63,7 +64,7 @@ typedef enum
sfEvtTouchEnded, ///< A touch event ended (data in event.touch)
sfEvtSensorChanged, ///< A sensor value changed (data in event.sensor)
sfEvtCount ///< Keep last -- the total number of event types
sfEvtCount ///< Keep last -- the total number of event types
} sfEventType;
+2 -2
View File
@@ -35,10 +35,10 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_WINDOW_EXPORTS)
#define CSFML_WINDOW_API CSFML_API_EXPORT
#define CSFML_WINDOW_API CSFML_API_EXPORT
#else
#define CSFML_WINDOW_API CSFML_API_IMPORT
#define CSFML_WINDOW_API CSFML_API_IMPORT
#endif
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/JoystickIdentification.h>
+111 -111
View File
@@ -143,7 +143,7 @@ typedef enum
sfKeyF15, ///< The F15 key
sfKeyPause, ///< The Pause key
sfKeyCount, ///< Keep last -- the total number of keyboard keys
sfKeyCount, ///< Keep last -- the total number of keyboard keys
} sfKeyCode;
@@ -157,118 +157,118 @@ typedef enum
////////////////////////////////////////////////////////////
typedef enum
{
sfScanUnknown = -1, //!< Represents any scancode not present in this enum
sfScanA = 0, //!< Keyboard a and A key
sfScanB, //!< Keyboard b and B key
sfScanC, //!< Keyboard c and C key
sfScanD, //!< Keyboard d and D key
sfScanE, //!< Keyboard e and E key
sfScanF, //!< Keyboard f and F key
sfScanG, //!< Keyboard g and G key
sfScanH, //!< Keyboard h and H key
sfScanI, //!< Keyboard i and I key
sfScanJ, //!< Keyboard j and J key
sfScanK, //!< Keyboard k and K key
sfScanL, //!< Keyboard l and L key
sfScanM, //!< Keyboard m and M key
sfScanN, //!< Keyboard n and N key
sfScanO, //!< Keyboard o and O key
sfScanP, //!< Keyboard p and P key
sfScanQ, //!< Keyboard q and Q key
sfScanR, //!< Keyboard r and R key
sfScanS, //!< Keyboard s and S key
sfScanT, //!< Keyboard t and T key
sfScanU, //!< Keyboard u and U key
sfScanV, //!< Keyboard v and V key
sfScanW, //!< Keyboard w and W key
sfScanX, //!< Keyboard x and X key
sfScanY, //!< Keyboard y and Y key
sfScanZ, //!< Keyboard z and Z key
sfScanNum1, //!< Keyboard 1 and ! key
sfScanNum2, //!< Keyboard 2 and @ key
sfScanNum3, //!< Keyboard 3 and # key
sfScanNum4, //!< Keyboard 4 and $ key
sfScanNum5, //!< Keyboard 5 and % key
sfScanNum6, //!< Keyboard 6 and ^ key
sfScanNum7, //!< Keyboard 7 and & key
sfScanNum8, //!< Keyboard 8 and * key
sfScanNum9, //!< Keyboard 9 and ) key
sfScanNum0, //!< Keyboard 0 and ) key
sfScanEnter, //!< Keyboard Enter/Return key
sfScanEscape, //!< Keyboard Escape key
sfScanBackspace, //!< Keyboard Backspace key
sfScanTab, //!< Keyboard Tab key
sfScanSpace, //!< Keyboard Space key
sfScanHyphen, //!< Keyboard - and _ key
sfScanEqual, //!< Keyboard = and +
sfScanLBracket, //!< Keyboard [ and { key
sfScanRBracket, //!< Keyboard ] and } key
sfScanUnknown = -1, //!< Represents any scancode not present in this enum
sfScanA = 0, //!< Keyboard a and A key
sfScanB, //!< Keyboard b and B key
sfScanC, //!< Keyboard c and C key
sfScanD, //!< Keyboard d and D key
sfScanE, //!< Keyboard e and E key
sfScanF, //!< Keyboard f and F key
sfScanG, //!< Keyboard g and G key
sfScanH, //!< Keyboard h and H key
sfScanI, //!< Keyboard i and I key
sfScanJ, //!< Keyboard j and J key
sfScanK, //!< Keyboard k and K key
sfScanL, //!< Keyboard l and L key
sfScanM, //!< Keyboard m and M key
sfScanN, //!< Keyboard n and N key
sfScanO, //!< Keyboard o and O key
sfScanP, //!< Keyboard p and P key
sfScanQ, //!< Keyboard q and Q key
sfScanR, //!< Keyboard r and R key
sfScanS, //!< Keyboard s and S key
sfScanT, //!< Keyboard t and T key
sfScanU, //!< Keyboard u and U key
sfScanV, //!< Keyboard v and V key
sfScanW, //!< Keyboard w and W key
sfScanX, //!< Keyboard x and X key
sfScanY, //!< Keyboard y and Y key
sfScanZ, //!< Keyboard z and Z key
sfScanNum1, //!< Keyboard 1 and ! key
sfScanNum2, //!< Keyboard 2 and @ key
sfScanNum3, //!< Keyboard 3 and # key
sfScanNum4, //!< Keyboard 4 and $ key
sfScanNum5, //!< Keyboard 5 and % key
sfScanNum6, //!< Keyboard 6 and ^ key
sfScanNum7, //!< Keyboard 7 and & key
sfScanNum8, //!< Keyboard 8 and * key
sfScanNum9, //!< Keyboard 9 and ) key
sfScanNum0, //!< Keyboard 0 and ) key
sfScanEnter, //!< Keyboard Enter/Return key
sfScanEscape, //!< Keyboard Escape key
sfScanBackspace, //!< Keyboard Backspace key
sfScanTab, //!< Keyboard Tab key
sfScanSpace, //!< Keyboard Space key
sfScanHyphen, //!< Keyboard - and _ key
sfScanEqual, //!< Keyboard = and +
sfScanLBracket, //!< Keyboard [ and { key
sfScanRBracket, //!< Keyboard ] and } key
// For US keyboards mapped to key 29 (Microsoft Keyboard Scan Code Specification)
// For Non-US keyboards mapped to key 42 (Microsoft Keyboard Scan Code Specification)
// Typical language mappings: Belg:£µ` FrCa:<>} Dan:*' Dutch:`´ Fren:µ* Ger:'# Ital:§ù LatAm:[}` Nor:*@ Span:ç} Swed:*' Swiss:$£} UK:~# Brazil:}]
sfScanBackslash, //!< Keyboard \ and | key OR various keys for Non-US keyboards
sfScanSemicolon, //!< Keyboard ; and : key
sfScanApostrophe, //!< Keyboard ' and " key
sfScanGrave, //!< Keyboard ` and ~ key
sfScanComma, //!< Keyboard , and < key
sfScanPeriod, //!< Keyboard . and > key
sfScanSlash, //!< Keyboard / and ? key
sfScanF1, //!< Keyboard F1 key
sfScanF2, //!< Keyboard F2 key
sfScanF3, //!< Keyboard F3 key
sfScanF4, //!< Keyboard F4 key
sfScanF5, //!< Keyboard F5 key
sfScanF6, //!< Keyboard F6 key
sfScanF7, //!< Keyboard F7 key
sfScanF8, //!< Keyboard F8 key
sfScanF9, //!< Keyboard F9 key
sfScanF10, //!< Keyboard F10 key
sfScanF11, //!< Keyboard F11 key
sfScanF12, //!< Keyboard F12 key
sfScanF13, //!< Keyboard F13 key
sfScanF14, //!< Keyboard F14 key
sfScanF15, //!< Keyboard F15 key
sfScanF16, //!< Keyboard F16 key
sfScanF17, //!< Keyboard F17 key
sfScanF18, //!< Keyboard F18 key
sfScanF19, //!< Keyboard F19 key
sfScanF20, //!< Keyboard F20 key
sfScanF21, //!< Keyboard F21 key
sfScanF22, //!< Keyboard F22 key
sfScanF23, //!< Keyboard F23 key
sfScanF24, //!< Keyboard F24 key
sfScanCapsLock, //!< Keyboard Caps %Lock key
sfScanPrintScreen, //!< Keyboard Print Screen key
sfScanScrollLock, //!< Keyboard Scroll %Lock key
sfScanPause, //!< Keyboard Pause key
sfScanInsert, //!< Keyboard Insert key
sfScanHome, //!< Keyboard Home key
sfScanPageUp, //!< Keyboard Page Up key
sfScanDelete, //!< Keyboard Delete Forward key
sfScanEnd, //!< Keyboard End key
sfScanPageDown, //!< Keyboard Page Down key
sfScanRight, //!< Keyboard Right Arrow key
sfScanLeft, //!< Keyboard Left Arrow key
sfScanDown, //!< Keyboard Down Arrow key
sfScanUp, //!< Keyboard Up Arrow key
sfScanNumLock, //!< Keypad Num %Lock and Clear key
sfScanNumpadDivide, //!< Keypad / key
sfScanNumpadMultiply, //!< Keypad * key
sfScanNumpadMinus, //!< Keypad - key
sfScanNumpadPlus, //!< Keypad + key
sfScanNumpadEqual, //!< keypad = key
sfScanNumpadEnter, //!< Keypad Enter/Return key
sfScanNumpadDecimal, //!< Keypad . and Delete key
sfScanNumpad1, //!< Keypad 1 and End key
sfScanNumpad2, //!< Keypad 2 and Down Arrow key
sfScanNumpad3, //!< Keypad 3 and Page Down key
sfScanNumpad4, //!< Keypad 4 and Left Arrow key
sfScanNumpad5, //!< Keypad 5 key
sfScanNumpad6, //!< Keypad 6 and Right Arrow key
sfScanNumpad7, //!< Keypad 7 and Home key
sfScanNumpad8, //!< Keypad 8 and Up Arrow key
sfScanNumpad9, //!< Keypad 9 and Page Up key
sfScanNumpad0, //!< Keypad 0 and Insert key
sfScanBackslash, //!< Keyboard \ and | key OR various keys for Non-US keyboards
sfScanSemicolon, //!< Keyboard ; and : key
sfScanApostrophe, //!< Keyboard ' and " key
sfScanGrave, //!< Keyboard ` and ~ key
sfScanComma, //!< Keyboard , and < key
sfScanPeriod, //!< Keyboard . and > key
sfScanSlash, //!< Keyboard / and ? key
sfScanF1, //!< Keyboard F1 key
sfScanF2, //!< Keyboard F2 key
sfScanF3, //!< Keyboard F3 key
sfScanF4, //!< Keyboard F4 key
sfScanF5, //!< Keyboard F5 key
sfScanF6, //!< Keyboard F6 key
sfScanF7, //!< Keyboard F7 key
sfScanF8, //!< Keyboard F8 key
sfScanF9, //!< Keyboard F9 key
sfScanF10, //!< Keyboard F10 key
sfScanF11, //!< Keyboard F11 key
sfScanF12, //!< Keyboard F12 key
sfScanF13, //!< Keyboard F13 key
sfScanF14, //!< Keyboard F14 key
sfScanF15, //!< Keyboard F15 key
sfScanF16, //!< Keyboard F16 key
sfScanF17, //!< Keyboard F17 key
sfScanF18, //!< Keyboard F18 key
sfScanF19, //!< Keyboard F19 key
sfScanF20, //!< Keyboard F20 key
sfScanF21, //!< Keyboard F21 key
sfScanF22, //!< Keyboard F22 key
sfScanF23, //!< Keyboard F23 key
sfScanF24, //!< Keyboard F24 key
sfScanCapsLock, //!< Keyboard Caps %Lock key
sfScanPrintScreen, //!< Keyboard Print Screen key
sfScanScrollLock, //!< Keyboard Scroll %Lock key
sfScanPause, //!< Keyboard Pause key
sfScanInsert, //!< Keyboard Insert key
sfScanHome, //!< Keyboard Home key
sfScanPageUp, //!< Keyboard Page Up key
sfScanDelete, //!< Keyboard Delete Forward key
sfScanEnd, //!< Keyboard End key
sfScanPageDown, //!< Keyboard Page Down key
sfScanRight, //!< Keyboard Right Arrow key
sfScanLeft, //!< Keyboard Left Arrow key
sfScanDown, //!< Keyboard Down Arrow key
sfScanUp, //!< Keyboard Up Arrow key
sfScanNumLock, //!< Keypad Num %Lock and Clear key
sfScanNumpadDivide, //!< Keypad / key
sfScanNumpadMultiply, //!< Keypad * key
sfScanNumpadMinus, //!< Keypad - key
sfScanNumpadPlus, //!< Keypad + key
sfScanNumpadEqual, //!< keypad = key
sfScanNumpadEnter, //!< Keypad Enter/Return key
sfScanNumpadDecimal, //!< Keypad . and Delete key
sfScanNumpad1, //!< Keypad 1 and End key
sfScanNumpad2, //!< Keypad 2 and Down Arrow key
sfScanNumpad3, //!< Keypad 3 and Page Down key
sfScanNumpad4, //!< Keypad 4 and Left Arrow key
sfScanNumpad5, //!< Keypad 5 key
sfScanNumpad6, //!< Keypad 6 and Right Arrow key
sfScanNumpad7, //!< Keypad 7 and Home key
sfScanNumpad8, //!< Keypad 8 and Up Arrow key
sfScanNumpad9, //!< Keypad 9 and Page Up key
sfScanNumpad0, //!< Keypad 0 and Insert key
// For US keyboards doesn't exist
// For Non-US keyboards mapped to key 45 (Microsoft Keyboard Scan Code Specification)
// Typical language mappings: Belg:<\> FrCa:«°» Dan:<\> Dutch:]|[ Fren:<> Ger:<|> Ital:<> LatAm:<> Nor:<> Span:<> Swed:<|> Swiss:<\> UK:\| Brazil: \|.
@@ -311,7 +311,7 @@ typedef enum
sfScanLaunchMail, //!< Keyboard Launch Mail key
sfScanLaunchMediaSelect, //!< Keyboard Launch Media Select key
sfScancodeCount //!< Keep last -- the total number of scancodes
sfScancodeCount //!< Keep last -- the total number of scancodes
} sfScancode;
+7 -6
View File
@@ -28,8 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Types.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Types.h>
////////////////////////////////////////////////////////////
@@ -38,11 +39,11 @@
////////////////////////////////////////////////////////////
typedef enum
{
sfMouseLeft, ///< The left mouse button
sfMouseRight, ///< The right mouse button
sfMouseMiddle, ///< The middle (wheel) mouse button
sfMouseXButton1, ///< The first extra mouse button
sfMouseXButton2, ///< The second extra mouse button
sfMouseLeft, ///< The left mouse button
sfMouseRight, ///< The right mouse button
sfMouseMiddle, ///< The middle (wheel) mouse button
sfMouseXButton1, ///< The first extra mouse button
sfMouseXButton2, ///< The second extra mouse button
sfMouseButtonCount ///< Keep last -- the total number of mouse buttons
} sfMouseButton;
+8 -7
View File
@@ -28,8 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Types.h>
#include <CSFML/System/Vector3.h>
#include <CSFML/Window/Types.h>
////////////////////////////////////////////////////////////
@@ -38,14 +39,14 @@
////////////////////////////////////////////////////////////
typedef enum
{
sfSensorAccelerometer, ///< Measures the raw acceleration (m/s^2)
sfSensorGyroscope, ///< Measures the raw rotation rates (degrees/s)
sfSensorMagnetometer, ///< Measures the ambient magnetic field (micro-teslas)
sfSensorGravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2)
sfSensorAccelerometer, ///< Measures the raw acceleration (m/s^2)
sfSensorGyroscope, ///< Measures the raw rotation rates (degrees/s)
sfSensorMagnetometer, ///< Measures the ambient magnetic field (micro-teslas)
sfSensorGravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2)
sfSensorUserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/s^2)
sfSensorOrientation, ///< Measures the absolute 3D orientation (degrees)
sfSensorOrientation, ///< Measures the absolute 3D orientation (degrees)
sfSensorCount ///< Keep last -- the total number of sensor types
sfSensorCount ///< Keep last -- the total number of sensor types
} sfSensorType;
+2 -1
View File
@@ -28,8 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Types.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Types.h>
////////////////////////////////////////////////////////////
+3 -3
View File
@@ -25,7 +25,7 @@
#pragma once
typedef struct sfContext sfContext;
typedef struct sfCursor sfCursor;
typedef struct sfWindow sfWindow;
typedef struct sfContext sfContext;
typedef struct sfCursor sfCursor;
typedef struct sfWindow sfWindow;
typedef struct sfWindowBase sfWindowBase;
+2
View File
@@ -28,7 +28,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/System/Vector2.h>
#include <stddef.h>
+3 -1
View File
@@ -26,12 +26,14 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <stddef.h>
typedef struct VkInstance_T* VkInstance;
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || \
defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
typedef struct VkSurfaceKHR_T* VkSurfaceKHR;
+19 -6
View File
@@ -28,12 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Event.h>
#include <CSFML/Window/Types.h>
#include <CSFML/Window/VideoMode.h>
#include <CSFML/Window/WindowBase.h>
#include <CSFML/Window/WindowHandle.h>
#include <CSFML/Window/Types.h>
#include <CSFML/System/Vector2.h>
////////////////////////////////////////////////////////////
@@ -42,7 +43,7 @@
////////////////////////////////////////////////////////////
typedef enum
{
sfContextDefault = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive)
sfContextDefault = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive)
sfContextCore = 1 << 0, ///< Core attribute
sfContextDebug = 1 << 2 ///< Debug attribute
} sfContextAttribute;
@@ -86,7 +87,11 @@ typedef struct
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, uint32_t style, sfWindowState state, const sfContextSettings* settings);
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode,
const char* title,
uint32_t style,
sfWindowState state,
const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a new window (with a UTF-32 title)
@@ -110,7 +115,12 @@ 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 sfChar32* title, uint32_t style, sfWindowState state, const sfContextSettings* settings);
CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(
sfVideoMode mode,
const sfChar32* title,
uint32_t style,
sfWindowState state,
const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a window from an existing control
@@ -485,4 +495,7 @@ CSFML_WINDOW_API sfWindowHandle sfWindow_getNativeHandle(const sfWindow* window)
/// \return True if surface creation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API bool sfWindow_createVulkanSurface(sfWindow* window, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
CSFML_WINDOW_API bool sfWindow_createVulkanSurface(sfWindow* window,
const VkInstance* instance,
VkSurfaceKHR* surface,
const VkAllocationCallbacks* allocator);
+14 -10
View File
@@ -28,12 +28,13 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Window/Export.h>
#include <CSFML/Window/Event.h>
#include <CSFML/Window/VideoMode.h>
#include <CSFML/Window/WindowHandle.h>
#include <CSFML/Window/Types.h>
#include <CSFML/Window/Vulkan.h>
#include <CSFML/System/Vector2.h>
#include <CSFML/Window/Event.h>
#include <CSFML/Window/Types.h>
#include <CSFML/Window/VideoMode.h>
#include <CSFML/Window/Vulkan.h>
#include <CSFML/Window/WindowHandle.h>
////////////////////////////////////////////////////////////
@@ -42,10 +43,10 @@
////////////////////////////////////////////////////////////
typedef enum
{
sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive)
sfTitlebar = 1 << 0, ///< Title bar + fixed border
sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button
sfClose = 1 << 2, ///< Titlebar + close button
sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive)
sfTitlebar = 1 << 0, ///< Title bar + fixed border
sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button
sfClose = 1 << 2, ///< Titlebar + close button
sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style
} sfWindowStyle;
@@ -388,4 +389,7 @@ CSFML_WINDOW_API sfWindowHandle sfWindowBase_getNativeHandle(const sfWindowBase*
/// \return True if surface creation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API bool 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);
+7 -7
View File
@@ -36,18 +36,18 @@
////////////////////////////////////////////////////////////
#if defined(CSFML_SYSTEM_WINDOWS)
// Window handle is HWND (HWND__*) on Windows
struct HWND__;
typedef struct HWND__* sfWindowHandle;
// Window handle is HWND (HWND__*) on Windows
struct HWND__;
typedef struct HWND__* sfWindowHandle;
#elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD)
// Window handle is Window (unsigned long) on Unix - X11
typedef unsigned long sfWindowHandle;
// Window handle is Window (unsigned long) on Unix - X11
typedef unsigned long sfWindowHandle;
#elif defined(CSFML_SYSTEM_MACOS)
// Window handle is NSWindow (void*) on Mac OS X - Cocoa
typedef void* sfWindowHandle;
// Window handle is NSWindow (void*) on Mac OS X - Cocoa
typedef void* sfWindowHandle;
#endif
+1 -1
View File
@@ -26,9 +26,9 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Listener.h>
#include <SFML/Audio/Listener.hpp>
#include <CSFML/System/ConvertVector3.hpp>
#include <SFML/Audio/Listener.hpp>
////////////////////////////////////////////////////////////
+5 -4
View File
@@ -27,8 +27,8 @@
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Music.h>
#include <CSFML/Audio/MusicStruct.hpp>
#include <CSFML/System/ConvertVector3.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/System/ConvertVector3.hpp>
////////////////////////////////////////////////////////////
@@ -65,7 +65,7 @@ sfMusic* sfMusic_createFromStream(sfInputStream* stream)
CSFML_CHECK_RETURN(stream, nullptr);
sfMusic* music = new sfMusic;
music->Stream = CallbackStream(stream);
music->Stream = CallbackStream(stream);
if (!music->This.openFromStream(music->Stream))
{
delete music;
@@ -126,8 +126,9 @@ sfTimeSpan sfMusic_getLoopPoints(const sfMusic* music)
////////////////////////////////////////////////////////////
void sfMusic_setLoopPoints(sfMusic* music, sfTimeSpan timePoints)
{
CSFML_CALL(music, setLoopPoints(sf::Music::TimeSpan({ sf::microseconds(timePoints.offset.microseconds),
sf::microseconds(timePoints.length.microseconds)})));
CSFML_CALL(music,
setLoopPoints(sf::Music::TimeSpan(
{sf::microseconds(timePoints.offset.microseconds), sf::microseconds(timePoints.length.microseconds)})));
}
+3 -2
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/Music.hpp>
#include <CSFML/CallbackStream.hpp>
#include <SFML/Audio/Music.hpp>
////////////////////////////////////////////////////////////
// Internal structure of sfMusic
@@ -37,5 +38,5 @@
struct sfMusic
{
CallbackStream Stream;
sf::Music This;
sf::Music This;
};
+2 -2
View File
@@ -27,8 +27,8 @@
////////////////////////////////////////////////////////////
#include <CSFML/Audio/Sound.h>
#include <CSFML/Audio/SoundStruct.hpp>
#include <CSFML/System/ConvertVector3.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/System/ConvertVector3.hpp>
////////////////////////////////////////////////////////////
@@ -36,7 +36,7 @@ sfSound* sfSound_create(const sfSoundBuffer* buffer)
{
CSFML_CHECK_RETURN(buffer, nullptr);
return new sfSound{ sf::Sound{ buffer->This }, buffer };
return new sfSound{sf::Sound{buffer->This}, buffer};
}
+8 -8
View File
@@ -53,13 +53,12 @@ sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInByt
}
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
{
CSFML_CHECK_RETURN(stream, nullptr);
CallbackStream sfmlStream(stream);
CallbackStream sfmlStream(stream);
sf::SoundBuffer soundBuffer;
if (!soundBuffer.loadFromStream(sfmlStream))
return nullptr;
@@ -69,12 +68,13 @@ sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_createFromSamples(const int16_t* samples,
uint64_t sampleCount,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize)
sfSoundBuffer* sfSoundBuffer_createFromSamples(
const int16_t* samples,
uint64_t sampleCount,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize)
{
std::vector<sf::SoundChannel> channelMap(channelMapSize);
for (std::size_t i = 0; i < channelMap.size(); ++i)
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/SoundBufferRecorder.hpp>
#include <CSFML/Audio/SoundBufferStruct.hpp>
#include <SFML/Audio/SoundBufferRecorder.hpp>
////////////////////////////////////////////////////////////
// Internal structure of sfSoundBufferRecorder
+8 -9
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/SoundRecorder.hpp>
#include <CSFML/Audio/SoundRecorder.h>
#include <SFML/Audio/SoundRecorder.hpp>
////////////////////////////////////////////////////////////
// Helper class implementing the callback forwarding from
@@ -37,21 +38,19 @@
////////////////////////////////////////////////////////////
class sfSoundRecorderImpl : public sf::SoundRecorder
{
public :
public:
sfSoundRecorderImpl(sfSoundRecorderStartCallback onStart,
sfSoundRecorderProcessCallback onProcess,
sfSoundRecorderStopCallback onStop,
void* userData) :
myStartCallback (onStart),
myStartCallback(onStart),
myProcessCallback(onProcess),
myStopCallback (onStop),
myUserData (userData)
myStopCallback(onStop),
myUserData(userData)
{
}
private :
private:
bool onStart() override
{
if (myStartCallback)
@@ -95,5 +94,5 @@ struct sfSoundRecorder
}
sfSoundRecorderImpl This;
std::string DeviceName;
std::string DeviceName;
};
+9 -8
View File
@@ -27,18 +27,19 @@
////////////////////////////////////////////////////////////
#include <CSFML/Audio/SoundStream.h>
#include <CSFML/Audio/SoundStreamStruct.hpp>
#include <CSFML/System/ConvertVector3.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/System/ConvertVector3.hpp>
////////////////////////////////////////////////////////////
sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback onSeek,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize,
void* userData)
sfSoundStream* sfSoundStream_create(
sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback onSeek,
unsigned int channelCount,
unsigned int sampleRate,
sfSoundChannel* channelMapData,
size_t channelMapSize,
void* userData)
{
return new sfSoundStream(onGetData, onSeek, channelCount, sampleRate, channelMapData, channelMapSize, userData);
}
+6 -7
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Audio/SoundChannel.h>
#include <SFML/Audio/SoundStream.hpp>
@@ -37,8 +38,7 @@
////////////////////////////////////////////////////////////
class sfSoundStreamImpl : public sf::SoundStream
{
public :
public:
sfSoundStreamImpl(sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback onSeek,
unsigned int channelCount,
@@ -47,8 +47,8 @@ public :
size_t channelMapSize,
void* userData) :
myGetDataCallback(onGetData),
mySeekCallback (onSeek),
myUserData (userData)
mySeekCallback(onSeek),
myUserData(userData)
{
std::vector<sf::SoundChannel> channelMap(channelMapSize);
for (std::size_t i = 0; i < channelMap.size(); ++i)
@@ -56,12 +56,11 @@ public :
initialize(channelCount, sampleRate, channelMap);
}
private :
private:
bool onGetData(Chunk& data) override
{
sfSoundStreamChunk chunk = {nullptr, 0};
bool ok = myGetDataCallback(&chunk, myUserData);
bool ok = myGetDataCallback(&chunk, myUserData);
data.samples = chunk.samples;
data.sampleCount = chunk.sampleCount;
+2 -1
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio/Sound.hpp>
#include <CSFML/Audio/SoundBufferStruct.hpp>
#include <SFML/Audio/Sound.hpp>
////////////////////////////////////////////////////////////
// Internal structure of sfSound
+3 -5
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/InputStream.hpp>
#include <CSFML/System/InputStream.h>
#include <SFML/System/InputStream.hpp>
////////////////////////////////////////////////////////////
/// \brief Adapts a CSFML input stream to a SFML input stream
@@ -38,7 +39,6 @@
class CallbackStream : public sf::InputStream
{
public:
////////////////////////////////////////////////////////////
/// \brief Default constructor
///
@@ -51,8 +51,7 @@ public:
/// \param stream CSFML input stream callbacks
///
////////////////////////////////////////////////////////////
CallbackStream(sfInputStream* stream) :
myStream(*stream)
CallbackStream(sfInputStream* stream) : myStream(*stream)
{
}
@@ -134,7 +133,6 @@ public:
}
private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
+4 -2
View File
@@ -27,8 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/String.hpp>
#include <CSFML/Config.h>
#include <SFML/System/String.hpp>
#include <string.h>
@@ -38,7 +40,7 @@
inline sfChar32* copyToChar32(const sf::String& str)
{
std::size_t byteCount = sizeof(sfChar32) * str.getSize();
sfChar32* utf32 = static_cast<sfChar32*>(malloc(byteCount + sizeof(sfChar32)));
sfChar32* utf32 = static_cast<sfChar32*>(malloc(byteCount + sizeof(sfChar32)));
memcpy(utf32, str.getData(), byteCount);
utf32[str.getSize()] = 0;
+2 -1
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/Event.hpp>
#include <CSFML/Window/Event.h>
#include <SFML/Window/Event.hpp>
////////////////////////////////////////////////////////////
// Define a function to convert a sf::Event to a sfEvent
+16 -12
View File
@@ -29,25 +29,29 @@
////////////////////////////////////////////////////////////
const sfBlendMode sfBlendAlpha = { sfBlendFactorSrcAlpha, sfBlendFactorOneMinusSrcAlpha, sfBlendEquationAdd,
sfBlendFactorOne, sfBlendFactorOneMinusSrcAlpha, sfBlendEquationAdd };
const sfBlendMode sfBlendAlpha = {sfBlendFactorSrcAlpha,
sfBlendFactorOneMinusSrcAlpha,
sfBlendEquationAdd,
sfBlendFactorOne,
sfBlendFactorOneMinusSrcAlpha,
sfBlendEquationAdd};
////////////////////////////////////////////////////////////
const sfBlendMode sfBlendAdd = { sfBlendFactorSrcAlpha, sfBlendFactorOne, sfBlendEquationAdd,
sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationAdd };
const sfBlendMode sfBlendAdd =
{sfBlendFactorSrcAlpha, sfBlendFactorOne, sfBlendEquationAdd, sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationAdd};
////////////////////////////////////////////////////////////
const sfBlendMode sfBlendMultiply = { sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd,
sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd };
const sfBlendMode sfBlendMultiply =
{sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd, sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd};
////////////////////////////////////////////////////////////
const sfBlendMode sfBlendMin = { sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin,
sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin };
const sfBlendMode sfBlendMin =
{sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin, sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin};
////////////////////////////////////////////////////////////
const sfBlendMode sfBlendMax = { sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax,
sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax };
const sfBlendMode sfBlendMax =
{sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax, sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax};
////////////////////////////////////////////////////////////
const sfBlendMode sfBlendNone = { sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd,
sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd };
const sfBlendMode sfBlendNone =
{sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd, sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd};
+4 -3
View File
@@ -29,17 +29,18 @@
#include <CSFML/Graphics/CircleShapeStruct.hpp>
#include <CSFML/Graphics/ConvertColor.hpp>
#include <CSFML/Graphics/ConvertRect.hpp>
#include <CSFML/System/ConvertVector2.hpp>
#include <SFML/Graphics/Color.hpp>
#include <CSFML/Graphics/ConvertTransform.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/System/ConvertVector2.hpp>
#include <SFML/Graphics/Color.hpp>
////////////////////////////////////////////////////////////
sfCircleShape* sfCircleShape_create()
{
sfCircleShape* shape = new sfCircleShape;
shape->Texture = nullptr;
shape->Texture = nullptr;
return shape;
}
+2 -1
View File
@@ -27,10 +27,11 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/CircleShape.hpp>
#include <CSFML/Graphics/TextureStruct.hpp>
#include <CSFML/Graphics/Transform.h>
#include <SFML/Graphics/CircleShape.hpp>
////////////////////////////////////////////////////////////
// Internal structure of sfCircleShape
+11 -10
View File
@@ -27,19 +27,20 @@
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Color.h>
#include <CSFML/Internal.hpp>
#include <algorithm>
////////////////////////////////////////////////////////////
sfColor sfBlack = sfColor_fromRGB( 0, 0, 0);
sfColor sfBlack = sfColor_fromRGB(0, 0, 0);
sfColor sfWhite = sfColor_fromRGB(255, 255, 255);
sfColor sfRed = sfColor_fromRGB(255, 0, 0);
sfColor sfGreen = sfColor_fromRGB( 0, 255, 0);
sfColor sfBlue = sfColor_fromRGB( 0, 0, 255);
sfColor sfYellow = sfColor_fromRGB(255, 255, 0);
sfColor sfMagenta = sfColor_fromRGB(255, 0, 255);
sfColor sfCyan = sfColor_fromRGB( 0, 255, 255);
sfColor sfTransparent = sfColor_fromRGBA( 0, 0, 0, 0);
sfColor sfRed = sfColor_fromRGB(255, 0, 0);
sfColor sfGreen = sfColor_fromRGB(0, 255, 0);
sfColor sfBlue = sfColor_fromRGB(0, 0, 255);
sfColor sfYellow = sfColor_fromRGB(255, 255, 0);
sfColor sfMagenta = sfColor_fromRGB(255, 0, 255);
sfColor sfCyan = sfColor_fromRGB(0, 255, 255);
sfColor sfTransparent = sfColor_fromRGBA(0, 0, 0, 0);
////////////////////////////////////////////////////////////
@@ -66,9 +67,9 @@ sfColor sfColor_fromRGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha
////////////////////////////////////////////////////////////
sfColor sfColor_fromInteger(uint32_t color)
{
uint8_t red = static_cast<uint8_t>((color & 0xff000000) >> 24);
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 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);
+2 -1
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Color.hpp>
#include <CSFML/Graphics/Color.h>
#include <SFML/Graphics/Color.hpp>
////////////////////////////////////////////////////////////
// Convert sf::Color to sfColor
+2 -1
View File
@@ -27,9 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Rect.hpp>
#include <CSFML/Graphics/Rect.h>
#include <SFML/Graphics/Rect.hpp>
////////////////////////////////////////////////////////////
// Convert sf::Rect<T> to CSFML Rect
+9 -8
View File
@@ -27,11 +27,12 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/RenderStates.h>
#include <SFML/Graphics/RenderStates.hpp>
#include <CSFML/Graphics/ConvertTransform.hpp>
#include <CSFML/Graphics/TextureStruct.hpp>
#include <CSFML/Graphics/RenderStates.h>
#include <CSFML/Graphics/ShaderStruct.hpp>
#include <CSFML/Graphics/TextureStruct.hpp>
#include <SFML/Graphics/RenderStates.hpp>
////////////////////////////////////////////////////////////
@@ -45,12 +46,12 @@
sf::RenderStates renderStates;
renderStates.blendMode.colorSrcFactor = static_cast<sf::BlendMode::Factor>(states->blendMode.colorSrcFactor);
renderStates.blendMode.colorDstFactor = static_cast<sf::BlendMode::Factor>(states->blendMode.colorDstFactor);
renderStates.blendMode.colorEquation = static_cast<sf::BlendMode::Equation>(states->blendMode.colorEquation);
renderStates.blendMode.colorEquation = static_cast<sf::BlendMode::Equation>(states->blendMode.colorEquation);
renderStates.blendMode.alphaSrcFactor = static_cast<sf::BlendMode::Factor>(states->blendMode.alphaSrcFactor);
renderStates.blendMode.alphaDstFactor = static_cast<sf::BlendMode::Factor>(states->blendMode.alphaDstFactor);
renderStates.blendMode.alphaEquation = static_cast<sf::BlendMode::Equation>(states->blendMode.alphaEquation);
renderStates.transform = convertTransform(states->transform);
renderStates.texture = states->texture ? states->texture->This : nullptr;
renderStates.shader = states->shader ? &states->shader->This : nullptr;
renderStates.blendMode.alphaEquation = static_cast<sf::BlendMode::Equation>(states->blendMode.alphaEquation);
renderStates.transform = convertTransform(states->transform);
renderStates.texture = states->texture ? states->texture->This : nullptr;
renderStates.shader = states->shader ? &states->shader->This : nullptr;
return renderStates;
}
+1
View File
@@ -28,6 +28,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Transform.h>
#include <SFML/Graphics/Transform.hpp>
+6 -5
View File
@@ -25,14 +25,15 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/ConvexShape.h>
#include <CSFML/Graphics/ConvexShapeStruct.hpp>
#include <SFML/Graphics/Color.hpp>
#include <CSFML/Graphics/ConvertTransform.hpp>
#include <CSFML/Graphics/ConvertColor.hpp>
#include <CSFML/Graphics/ConvertRect.hpp>
#include <CSFML/System/ConvertVector2.hpp>
#include <CSFML/Graphics/ConvertTransform.hpp>
#include <CSFML/Graphics/ConvexShape.h>
#include <CSFML/Graphics/ConvexShapeStruct.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/System/ConvertVector2.hpp>
#include <SFML/Graphics/Color.hpp>
////////////////////////////////////////////////////////////
+2 -1
View File
@@ -27,10 +27,11 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/ConvexShape.hpp>
#include <CSFML/Graphics/TextureStruct.hpp>
#include <CSFML/Graphics/Transform.h>
#include <SFML/Graphics/ConvexShape.hpp>
////////////////////////////////////////////////////////////
// Internal structure of sfConvexShape
+3 -3
View File
@@ -25,11 +25,11 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/CallbackStream.hpp>
#include <CSFML/Graphics/ConvertRect.hpp>
#include <CSFML/Graphics/Font.h>
#include <CSFML/Graphics/FontStruct.hpp>
#include <CSFML/Graphics/ConvertRect.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/CallbackStream.hpp>
////////////////////////////////////////////////////////////
@@ -164,7 +164,7 @@ void sfFont_setSmooth(sfFont* font, bool smooth)
////////////////////////////////////////////////////////////
bool sfFont_isSmooth(const sfFont *font)
bool sfFont_isSmooth(const sfFont* font)
{
return font->This.isSmooth();
}
+6 -4
View File
@@ -27,9 +27,11 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Font.hpp>
#include <CSFML/Graphics/TextureStruct.hpp>
#include <CSFML/CallbackStream.hpp>
#include <CSFML/Graphics/TextureStruct.hpp>
#include <SFML/Graphics/Font.hpp>
#include <map>
@@ -38,7 +40,7 @@
////////////////////////////////////////////////////////////
struct sfFont
{
sf::Font This;
sf::Font This;
std::map<unsigned int, sfTexture> Textures;
CallbackStream Stream;
CallbackStream Stream;
};
+7 -7
View File
@@ -25,14 +25,14 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <CSFML/Graphics/Image.h>
#include <CSFML/Graphics/ImageStruct.hpp>
#include <CSFML/CallbackStream.hpp>
#include <CSFML/Graphics/ConvertColor.hpp>
#include <CSFML/Graphics/ConvertRect.hpp>
#include <CSFML/System/ConvertVector2.hpp>
#include <CSFML/System/BufferStruct.hpp>
#include <CSFML/Graphics/Image.h>
#include <CSFML/Graphics/ImageStruct.hpp>
#include <CSFML/Internal.hpp>
#include <CSFML/CallbackStream.hpp>
#include <CSFML/System/BufferStruct.hpp>
#include <CSFML/System/ConvertVector2.hpp>
////////////////////////////////////////////////////////////
@@ -84,7 +84,7 @@ sfImage* sfImage_createFromStream(sfInputStream* stream)
CSFML_CHECK_RETURN(stream, nullptr);
CallbackStream sfmlStream(stream);
sf::Image image;
sf::Image image;
if (!image.loadFromStream(sfmlStream))
return nullptr;
@@ -123,7 +123,7 @@ bool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* fo
auto data = image->This.saveToMemory(format);
if (data)
if (data)
{
output->buffer = std::move(*data);
return true;
Loaded 100 of 156 files, more files were not shown because too many files have changed in this diff. Show more