mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-25 05:03:36 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5facb85d1 | ||
|
|
55be7dbfd6 | ||
|
|
bca82a4c6b | ||
|
|
6dca26ed3c | ||
|
|
8ec6eb094f | ||
|
|
aed28415ed | ||
|
|
2e47e5dbda | ||
|
|
1226d9db94 | ||
|
|
57eda5f923 | ||
|
|
dbc7147b47 | ||
|
|
b56ca39562 | ||
|
|
52c7de16f0 | ||
|
|
4d35e0a91c | ||
|
|
16c3b6936a | ||
|
|
2aee52d65f | ||
|
|
94558cdb63 | ||
|
|
f512854b54 | ||
|
|
d78a8bfa33 | ||
|
|
2017578197 | ||
|
|
6ec6c104a8 | ||
|
|
4e269cf863 | ||
|
|
e4e1bcb139 | ||
|
|
45fe62b7ed | ||
|
|
a192e85345 | ||
|
|
0e8c6379f0 | ||
|
|
8a7ba8ae8e | ||
|
|
9df98d8c17 | ||
|
|
14653882ae | ||
|
|
3f63678eaa | ||
|
|
ac9b33dd1a | ||
|
|
470bf3d190 | ||
|
|
41fa94478a | ||
|
|
3c70f99028 | ||
|
|
15995fa19c | ||
|
|
962a685570 | ||
|
|
ae727f0a04 | ||
|
|
784b20038f | ||
|
|
490a21fdff | ||
|
|
864d7b822a | ||
|
|
16ea259e04 | ||
|
|
36430b11c7 | ||
|
|
826ebac51a | ||
|
|
ce5e3a3891 | ||
|
|
21e8e0523f | ||
|
|
bf46c5386a | ||
|
|
da9cce8350 | ||
|
|
9d757589ba | ||
|
|
74220430ea | ||
|
|
dc3ba7cc33 | ||
|
|
19e3a18cde | ||
|
|
66451e6596 | ||
|
|
92fb5f6dc8 | ||
|
|
ef49a86942 | ||
|
|
e8224208a2 | ||
|
|
e3df1539f5 | ||
|
|
3e767dec4f | ||
|
|
068bb14937 | ||
|
|
d91b8d0dfb | ||
|
|
9bf4197e0a | ||
|
|
ee9b927dec | ||
|
|
9e1cd46c73 | ||
|
|
2e272c187f | ||
|
|
910bcc86d0 | ||
|
|
448949ef7a | ||
|
|
33bf91a1da | ||
|
|
9f4c4abaca | ||
|
|
4069448128 | ||
|
|
4720e109b6 | ||
|
|
f3153dc9c1 | ||
|
|
a424e91a54 | ||
|
|
1d0d7164c8 | ||
|
|
1486a30e2f | ||
|
|
88a59374bc | ||
|
|
78eea7face | ||
|
|
90b168aaaf | ||
|
|
2ca7fbfb61 | ||
|
|
2d9ae6cd04 | ||
|
|
0fe078ec8a | ||
|
|
10d785df80 | ||
|
|
728a0e0002 | ||
|
|
3de58bfef4 | ||
|
|
57d3ee0d89 | ||
|
|
e5c4b0927d |
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
|
||||
# define a macro that helps defining an option
|
||||
macro(csfml_set_option var default type docstring)
|
||||
@@ -21,7 +21,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake)
|
||||
|
||||
# setup version numbers
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 2)
|
||||
set(VERSION_MINOR 4)
|
||||
set(VERSION_PATCH 0)
|
||||
|
||||
# add the CSFML header path
|
||||
|
||||
@@ -56,6 +56,14 @@ macro(csfml_add_library target)
|
||||
# link the target to its external dependencies (C++ SFML libraries)
|
||||
target_link_libraries(${target} ${THIS_DEPENDS})
|
||||
|
||||
# build dylibs
|
||||
if(SFML_OS_MACOSX AND BUILD_SHARED_LIBS)
|
||||
# adapt install directory to allow distributing dylibs in user’s application bundle
|
||||
set_target_properties(${target} PROPERTIES
|
||||
BUILD_WITH_INSTALL_RPATH 1
|
||||
INSTALL_NAME_DIR "@rpath")
|
||||
endif()
|
||||
|
||||
# add the install rule
|
||||
install(TARGETS ${target}
|
||||
RUNTIME DESTINATION bin COMPONENT bin
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
|
||||
DESTINATION ${INSTALL_MISC_DIR}/doc
|
||||
COMPONENT doc)
|
||||
if(DOXYGEN_HHC_PROGRAM)
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/SFML.chm
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/CSFML.chm
|
||||
DESTINATION ${INSTALL_MISC_DIR}/doc
|
||||
COMPONENT doc)
|
||||
endif()
|
||||
+3
-3
@@ -25,7 +25,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
|
||||
PROJECT_NAME = SFML
|
||||
PROJECT_NAME = CSFML
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
@@ -851,7 +851,7 @@ GENERATE_HTMLHELP = @DOXYGEN_GENERATE_HTMLHELP@
|
||||
# can add a path in front of the file if the result should not be
|
||||
# written to the html output directory.
|
||||
|
||||
CHM_FILE = ../SFML.chm
|
||||
CHM_FILE = ../CSFML.chm
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
|
||||
# be used to specify the location (absolute path including file name) of
|
||||
@@ -1329,7 +1329,7 @@ CLASS_DIAGRAMS = YES
|
||||
# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
||||
# default search path.
|
||||
|
||||
MSCGEN_PATH = D:/Programmes/mscgen
|
||||
MSCGEN_PATH =
|
||||
|
||||
# If set to YES, the inheritance and collaboration graphs will hide
|
||||
# inheritance and usage relations if the target is undocumented
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include <SFML/Audio/SoundBuffer.h>
|
||||
#include <SFML/Audio/SoundBufferRecorder.h>
|
||||
#include <SFML/Audio/SoundRecorder.h>
|
||||
#include <SFML/Audio/SoundStatus.h>
|
||||
#include <SFML/Audio/SoundStream.h>
|
||||
|
||||
|
||||
#endif // SFML_AUDIO_H
|
||||
@@ -92,7 +92,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str
|
||||
/// \return A new sfSoundBuffer object (NULL if failed)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate);
|
||||
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a new sound buffer by copying an existing one
|
||||
@@ -152,7 +152,7 @@ CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* sou
|
||||
/// \return Number of samples
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
|
||||
CSFML_AUDIO_API sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the sample rate of a sound buffer
|
||||
|
||||
@@ -61,8 +61,10 @@ CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundB
|
||||
/// \param soundBufferRecorder Sound buffer recorder object
|
||||
/// \param sampleRate Desired capture rate, in number of samples per second
|
||||
///
|
||||
/// \return sfTrue, if it was able to start recording
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
|
||||
CSFML_AUDIO_API sfBool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Stop the capture of a sound recorder
|
||||
@@ -101,5 +103,31 @@ CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBu
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the audio capture device
|
||||
///
|
||||
/// This function sets the audio capture device to the device
|
||||
/// with the given name. It can be called on the fly (i.e:
|
||||
/// while recording). If you do so while recording and
|
||||
/// opening the device fails, it stops the recording.
|
||||
///
|
||||
/// \param soundBufferRecorder Sound buffer recorder object
|
||||
/// \param name The name of the audio capture device
|
||||
///
|
||||
/// \return sfTrue, if it was able to set the requested device
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfBool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the name of the current audio capture device
|
||||
///
|
||||
/// \param soundBufferRecorder Sound buffer recorder object
|
||||
///
|
||||
/// \return The name of the current audio capture device
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API const char* sfSoundBufferRecorder_getDevice(sfSoundBufferRecorder* soundBufferRecorder);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDBUFFERRECORDER_H
|
||||
@@ -129,7 +129,7 @@ CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
|
||||
/// The default processing interval is 100 ms.
|
||||
///
|
||||
/// \param soundRecorder Sound recorder object
|
||||
/// \param interval Processing interval
|
||||
/// \param interval Processing interval
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval);
|
||||
@@ -168,7 +168,7 @@ CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice();
|
||||
/// opening the device fails, it stops the recording.
|
||||
///
|
||||
/// \param soundRecorder Sound recorder object
|
||||
/// \param The name of the audio capture device
|
||||
/// \param name The name of the audio capture device
|
||||
///
|
||||
/// \return sfTrue, if it was able to set the requested device
|
||||
///
|
||||
@@ -185,5 +185,33 @@ CSFML_AUDIO_API sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder,
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the channel count of the audio capture device
|
||||
///
|
||||
/// This method allows you to specify the number of channels
|
||||
/// used for recording. Currently only 16-bit mono and
|
||||
/// 16-bit stereo are supported.
|
||||
///
|
||||
/// \param channelCount Number of channels. Currently only
|
||||
/// mono (1) and stereo (2) are supported.
|
||||
///
|
||||
/// \see sfSoundRecorder_getChannelCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundRecorder_setChannelCount(sfSoundRecorder* soundRecorder, unsigned int channelCount);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the number of channels used by this recorder
|
||||
///
|
||||
/// Currently only mono and stereo are supported, so the
|
||||
/// value is either 1 (for mono) or 2 (for stereo).
|
||||
///
|
||||
/// \return Number of channels
|
||||
///
|
||||
/// \see sfSoundRecorder_setChannelCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API unsigned int sfSoundRecorder_getChannelCount(const sfSoundRecorder* soundRecorder);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDRECORDER_H
|
||||
+37
-1
@@ -30,7 +30,7 @@
|
||||
// Define the CSFML version
|
||||
////////////////////////////////////////////////////////////
|
||||
#define CSFML_VERSION_MAJOR 2
|
||||
#define CSFML_VERSION_MINOR 2
|
||||
#define CSFML_VERSION_MINOR 4
|
||||
#define CSFML_VERSION_PATCH 0
|
||||
|
||||
|
||||
@@ -110,6 +110,42 @@
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Cross-platform warning for deprecated functions and classes
|
||||
//
|
||||
// Usage:
|
||||
// struct CSFML_DEPRECATED MyStruct
|
||||
// {
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// CSFML_DEPRECATED void globalFunc();
|
||||
////////////////////////////////////////////////////////////
|
||||
#if defined(CSFML_NO_DEPRECATED_WARNINGS)
|
||||
|
||||
// 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)
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
// 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
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Define a portable boolean type
|
||||
|
||||
@@ -35,14 +35,15 @@
|
||||
#include <SFML/Graphics/Color.h>
|
||||
#include <SFML/Graphics/ConvexShape.h>
|
||||
#include <SFML/Graphics/Font.h>
|
||||
#include <SFML/Graphics/FontInfo.h>
|
||||
#include <SFML/Graphics/Glyph.h>
|
||||
#include <SFML/Graphics/Image.h>
|
||||
#include <SFML/Graphics/PrimitiveType.h>
|
||||
#include <SFML/Graphics/Rect.h>
|
||||
#include <SFML/Graphics/RectangleShape.h>
|
||||
#include <SFML/Graphics/RenderStates.h>
|
||||
#include <SFML/Graphics/RenderWindow.h>
|
||||
#include <SFML/Graphics/RenderTexture.h>
|
||||
#include <SFML/Graphics/RenderWindow.h>
|
||||
#include <SFML/Graphics/Shader.h>
|
||||
#include <SFML/Graphics/Shape.h>
|
||||
#include <SFML/Graphics/Sprite.h>
|
||||
|
||||
@@ -56,8 +56,9 @@ typedef enum
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
sfBlendEquationAdd, ///< Pixel = Src * SrcFactor + Dst * DstFactor
|
||||
sfBlendEquationSubtract ///< Pixel = Src * SrcFactor - Dst * DstFactor
|
||||
sfBlendEquationAdd, ///< Pixel = Src * SrcFactor + Dst * DstFactor
|
||||
sfBlendEquationSubtract, ///< Pixel = Src * SrcFactor - Dst * DstFactor
|
||||
sfBlendEquationReverseSubtract ///< Pixel = Dst * DstFactor - Src * SrcFactor
|
||||
} sfBlendEquation;
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -57,7 +58,7 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing circle Shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfCircleShape_destroy(sfCircleShape* shape);
|
||||
@@ -352,7 +353,7 @@ CSFML_GRAPHICS_API float sfCircleShape_getOutlineThickness(const sfCircleShape*
|
||||
/// \return Number of points of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape);
|
||||
CSFML_GRAPHICS_API size_t sfCircleShape_getPointCount(const sfCircleShape* shape);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get a point of a circle shape
|
||||
@@ -365,7 +366,7 @@ CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape*
|
||||
/// \return Index-th point of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index);
|
||||
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, size_t index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the radius of a circle
|
||||
@@ -393,7 +394,7 @@ CSFML_GRAPHICS_API float sfCircleShape_getRadius(const sfCircleShape* shape);
|
||||
/// \param count New number of points of the circle
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count);
|
||||
CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, size_t count);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the local bounding rectangle of a circle shape
|
||||
|
||||
@@ -80,6 +80,24 @@ CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 b
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Construct the color from 32-bit unsigned integer
|
||||
///
|
||||
/// \param color Number containing the RGBA components (in that order)
|
||||
///
|
||||
/// \return sfColor constructed from the 32-bit unsigned integer
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfColor_fromInteger(sfUint32 color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Convert a color to a 32-bit unsigned integer
|
||||
///
|
||||
/// \return Color represented as a 32-bit unsigned integer
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfUint32 sfColor_toInteger(sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Add two colors
|
||||
///
|
||||
@@ -91,6 +109,17 @@ CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfColor_add(sfColor color1, sfColor color2);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Subtract two colors
|
||||
///
|
||||
/// \param color1 First color
|
||||
/// \param color2 Second color
|
||||
///
|
||||
/// \return Component-wise saturated subtraction of the two colors
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfColor_subtract(sfColor color1, sfColor color2);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Modulate two colors
|
||||
///
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -57,7 +58,7 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing convex Shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfConvexShape_destroy(sfConvexShape* shape);
|
||||
@@ -352,7 +353,7 @@ CSFML_GRAPHICS_API float sfConvexShape_getOutlineThickness(const sfConvexShape*
|
||||
/// \return Number of points of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape);
|
||||
CSFML_GRAPHICS_API size_t sfConvexShape_getPointCount(const sfConvexShape* shape);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get a point of a convex shape
|
||||
@@ -365,7 +366,7 @@ CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape*
|
||||
/// \return Index-th point of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index);
|
||||
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, size_t index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the number of points of a convex shap
|
||||
@@ -376,7 +377,7 @@ CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape,
|
||||
/// \param count New number of points of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count);
|
||||
CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, size_t count);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the position of a point in a convex shape
|
||||
@@ -392,7 +393,7 @@ CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, unsign
|
||||
/// \param point New point
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point);
|
||||
CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, size_t index, sfVector2f point);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the local bounding rectangle of a convex shape
|
||||
|
||||
@@ -88,15 +88,16 @@ CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get a glyph in a font
|
||||
///
|
||||
/// \param font Source font
|
||||
/// \param codePoint Unicode code point of the character to get
|
||||
/// \param characterSize Character size, in pixels
|
||||
/// \param bold Retrieve the bold version or the regular one?
|
||||
/// \param font Source font
|
||||
/// \param codePoint Unicode code point of the character to get
|
||||
/// \param characterSize Character size, in pixels
|
||||
/// \param bold Retrieve the bold version or the regular one?
|
||||
/// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled)
|
||||
///
|
||||
/// \return The corresponding glyph
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
|
||||
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the kerning value corresponding to a given pair of characters in a font
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it freely,
|
||||
// subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented;
|
||||
// you must not claim that you wrote the original software.
|
||||
// If you use this software in a product, an acknowledgment
|
||||
// in the product documentation would be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such,
|
||||
// and must not be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef SFML_GLSL_H
|
||||
#define SFML_GLSL_H
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Color.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <SFML/System/Vector3.h>
|
||||
|
||||
// 2D vectors
|
||||
typedef sfVector2f sfGlslVec2;
|
||||
typedef sfVector2i sfGlslIvec2;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sfBool x;
|
||||
sfBool y;
|
||||
} sfGlslBvec2;
|
||||
|
||||
// 3D vectors
|
||||
typedef sfVector3f sfGlslVec3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
} sfGlslIvec3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sfBool x;
|
||||
sfBool y;
|
||||
sfBool z;
|
||||
} sfGlslBvec3;
|
||||
|
||||
// 4D vectors
|
||||
typedef struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
} sfGlslVec4;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int w;
|
||||
} sfGlslIvec4;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sfBool x;
|
||||
sfBool y;
|
||||
sfBool z;
|
||||
sfBool w;
|
||||
} sfGlslBvec4;
|
||||
|
||||
// matrices
|
||||
typedef struct
|
||||
{
|
||||
float array[3 * 3];
|
||||
} sfGlslMat3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float array[4 * 4];
|
||||
} sfGlslMat4;
|
||||
|
||||
|
||||
#endif // SFML_GLSL_H
|
||||
@@ -41,13 +41,17 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
sfPoints, ///< List of individual points
|
||||
sfLines, ///< List of individual lines
|
||||
sfLinesStrip, ///< List of connected lines, a point uses the previous point to form a line
|
||||
sfTriangles, ///< List of individual triangles
|
||||
sfTrianglesStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle
|
||||
sfTrianglesFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle
|
||||
sfQuads ///< List of individual quads
|
||||
sfPoints, ///< List of individual points
|
||||
sfLines, ///< List of individual lines
|
||||
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
|
||||
sfQuads, ///< List of individual quads
|
||||
|
||||
sfLinesStrip = sfLineStrip, ///< \deprecated Use sfLineStrip instead
|
||||
sfTrianglesStrip = sfTriangleStrip, ///< \deprecated Use sfTriangleStrip instead
|
||||
sfTrianglesFan = sfTriangleFan ///< \deprecated Use sfTriangleFan instead
|
||||
} sfPrimitiveType;
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -57,7 +58,7 @@ CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShap
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing rectangle shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape);
|
||||
@@ -352,7 +353,7 @@ CSFML_GRAPHICS_API float sfRectangleShape_getOutlineThickness(const sfRectangleS
|
||||
/// \return Number of points of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape);
|
||||
CSFML_GRAPHICS_API size_t sfRectangleShape_getPointCount(const sfRectangleShape* shape);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get a point of a rectangle shape
|
||||
@@ -365,7 +366,7 @@ CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount(const sfRectangle
|
||||
/// \return Index-th point of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index);
|
||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, size_t index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the size of a rectangle shape
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <SFML/Graphics/RenderStates.h>
|
||||
#include <SFML/Graphics/Vertex.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -216,7 +217,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderT
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
const sfVertex* vertices, size_t vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -315,4 +316,21 @@ CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTextu
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Generate a mipmap using the current texture data
|
||||
///
|
||||
/// This function is similar to sfTexture_generateMipmap and operates
|
||||
/// on the texture used as the target for drawing.
|
||||
/// Be aware that any draw operation may modify the base level image data.
|
||||
/// For this reason, calling this function only makes sense after all
|
||||
/// drawing is completed and display has been called. Not calling display
|
||||
/// after subsequent drawing will lead to undefined behavior if a mipmap
|
||||
/// had been previously generated.
|
||||
///
|
||||
/// \return sfTrue if mipmap generation was successful, sfFalse if unsuccessful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture);
|
||||
|
||||
|
||||
#endif // SFML_RENDERTEXTURE_H
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <SFML/Window/WindowHandle.h>
|
||||
#include <SFML/Window/Window.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -207,6 +208,15 @@ CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, uns
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable / disable vertical synchronization on a render window
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the mouse cursor on a render window
|
||||
///
|
||||
@@ -217,13 +227,19 @@ CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow,
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable / disable vertical synchronization on a render window
|
||||
/// \brief Grab or release the mouse cursor
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
|
||||
/// If set, grabs the mouse cursor inside this window's client
|
||||
/// area so it may no longer be moved outside its bounds.
|
||||
/// Note that grabbing is only active while the window has
|
||||
/// focus and calling this function for fullscreen windows
|
||||
/// won't have any effect (fullscreen windows always grab the
|
||||
/// cursor).
|
||||
///
|
||||
/// \param grabbed sfTrue to enable, sfFalse to disable
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable automatic key-repeat for keydown events
|
||||
@@ -236,6 +252,24 @@ CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* re
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency for a render window
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold, ie. the value below which no move event will be generated
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param threshold New threshold, in range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Activate or deactivate a render window as the current target for rendering
|
||||
///
|
||||
@@ -281,24 +315,6 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWi
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency for a render window
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold, ie. the value below which no move event will be generated
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param threshold New threshold, in range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Retrieve the OS-specific handle of a render window
|
||||
///
|
||||
@@ -441,7 +457,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWin
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
const sfVertex* vertices, size_t vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -493,22 +509,31 @@ CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow)
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Copy the current contents of a render window to an image
|
||||
/// \brief Copy the current contents of the window to an image
|
||||
///
|
||||
/// \deprecated
|
||||
/// Use a sfTexture and its
|
||||
/// sfTexture_updateFromRenderWindow(sfTexture*, const sfRenderWindow*, unsigned int, unsigned int)
|
||||
/// function and copy its contents into an sfImage instead.
|
||||
/// \code
|
||||
/// sfVector2u windowSize = sfRenderWindow_getSize(window);
|
||||
/// sfTexture* texture = sfTexture_create(windowSize.x, windowSize.y);
|
||||
/// sfTexture_updateFromRenderWindow(texture, window, windowSize.x, windowSize.y);
|
||||
/// sfImage* screenshot = sfTexture_copyToImage(texture);
|
||||
/// \endcode
|
||||
///
|
||||
/// This is a slow operation, whose main purpose is to make
|
||||
/// screenshots of the application. If you want to update an
|
||||
/// image with the contents of the window and then use it for
|
||||
/// drawing, you should rather use a sfTexture and its
|
||||
/// update(sfWindow*) function.
|
||||
/// drawing, you should rather use a sfTexture and the
|
||||
/// sfTexture_updateFromWindow(sfTexture*, const sfWindow*, unsigned int, unsigned int) function.
|
||||
/// You can also draw things directly to a texture with the
|
||||
/// sfRenderWindow class.
|
||||
/// sfRenderTexture class.
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
///
|
||||
/// \return New image containing the captured contents
|
||||
/// \return sfImage containing the captured contents.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current position of the mouse relative to a render-window
|
||||
|
||||
+353
-25
@@ -30,69 +30,74 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics/Export.h>
|
||||
#include <SFML/Graphics/Color.h>
|
||||
#include <SFML/Graphics/Glsl.h>
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/System/InputStream.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <SFML/System/Vector3.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from files
|
||||
/// \brief Load the vertex, geometry and fragment shaders from files
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function loads the vertex, geometry and fragment
|
||||
/// shaders. Pass NULL if you don't want to load
|
||||
/// a specific shader.
|
||||
/// The sources must be text files containing valid shaders
|
||||
/// in GLSL language. GLSL is a C-like language dedicated to
|
||||
/// OpenGL shaders; you'll probably need to read a good documentation
|
||||
/// for it before writing your own shaders.
|
||||
///
|
||||
/// \param vertexShaderFilename Path of the vertex shader file to load, or NULL to skip this shader
|
||||
/// \param geometryShaderFilename Path of the geometry shader file to load, or NULL to skip this shader
|
||||
/// \param fragmentShaderFilename Path of the fragment shader file to load, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from source codes in memory
|
||||
/// \brief Load the vertex, geometry and fragment shaders from source code in memory
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function loads the vertex, geometry and fragment
|
||||
/// shaders. Pass NULL if you don't want to load
|
||||
/// a specific shader.
|
||||
/// The sources must be valid shaders in GLSL language. GLSL is
|
||||
/// a C-like language dedicated to OpenGL shaders; you'll
|
||||
/// probably need to read a good documentation for it before
|
||||
/// writing your own shaders.
|
||||
///
|
||||
/// \param vertexShader String containing the source code of the vertex shader, or NULL to skip this shader
|
||||
/// \param geometryShader String containing the source code of the geometry shader, or NULL to skip this shader
|
||||
/// \param fragmentShader String containing the source code of the fragment shader, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from custom streams
|
||||
/// \brief Load the vertex, geometry and fragment shaders from custom streams
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function loads the vertex, geometry and fragment
|
||||
/// shaders. Pass NULL if you don't want to load
|
||||
/// a specific shader.
|
||||
/// The source codes must be valid shaders in GLSL language.
|
||||
/// GLSL is a C-like language dedicated to OpenGL shaders;
|
||||
/// you'll probably need to read a good documentation for
|
||||
/// it before writing your own shaders.
|
||||
///
|
||||
/// \param vertexShaderStream Source stream to read the vertex shader from, or NULL to skip this shader
|
||||
/// \param geometryShaderStream Source stream to read the geometry shader from, or NULL to skip this shader
|
||||
/// \param fragmentShaderStream Source stream to read the fragment shader from, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing shader
|
||||
@@ -102,6 +107,297 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShad
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p float uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param x Value of the float scalar
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloatUniform(sfShader* shader, const char* name, float x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec2 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the vec2 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec2Uniform(sfShader* shader, const char* name, sfGlslVec2 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec3 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the vec3 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec3Uniform(sfShader* shader, const char* name, sfGlslVec3 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec4 uniform
|
||||
///
|
||||
/// sfColor objects can be passed to this function via
|
||||
/// the use of sfGlslVec4_fromsfColor(sfColor);
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the vec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec4Uniform(sfShader* shader, const char* name, sfGlslVec4 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec4 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param color Value of the vec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setColorUniform(sfShader* shader, const char* name, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p int uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param x Value of the integer scalar
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIntUniform(sfShader* shader, const char* name, int x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec2 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the ivec2 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIvec2Uniform(sfShader* shader, const char* name, sfGlslIvec2 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec3 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the ivec3 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIvec3Uniform(sfShader* shader, const char* name, sfGlslIvec3 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec4 uniform
|
||||
///
|
||||
/// sfColor objects can be passed to this function via
|
||||
/// the use of sfGlslIvec4_fromsfColor(sfColor);
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the ivec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIvec4Uniform(sfShader* shader, const char* name, sfGlslIvec4 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec4 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param color Value of the ivec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p bool uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param x Value of the bool scalar
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBoolUniform(sfShader* shader, const char* name, sfBool x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p bvec2 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the bvec2 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBvec2Uniform(sfShader* shader, const char* name, sfGlslBvec2 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p Bvec3 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the Bvec3 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBvec3Uniform(sfShader* shader, const char* name, sfGlslBvec3 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p bvec4 uniform
|
||||
///
|
||||
/// sfColor objects can be passed to this function via
|
||||
/// the use of sfGlslIvec4_fromsfColor(sfColor);
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the bvec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBvec4Uniform(sfShader* shader, const char* name, sfGlslBvec4 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p mat3 matrix
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrix Value of the mat3 matrix
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat3Uniform(sfShader* shader, const char* name, const sfGlslMat3* matrix);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p mat4 matrix
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrix Value of the mat4 matrix
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat4Uniform(sfShader* shader, const char* name, const sfGlslMat4* matrix);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify a texture as \p sampler2D uniform
|
||||
///
|
||||
/// \a name is the name of the variable to change in the shader.
|
||||
/// The corresponding parameter in the shader must be a 2D texture
|
||||
/// (\p sampler2D GLSL type).
|
||||
///
|
||||
/// Example:
|
||||
/// \code
|
||||
/// uniform sampler2D the_texture; // this is the variable in the shader
|
||||
/// \endcode
|
||||
/// \code
|
||||
/// sfTexture texture;
|
||||
/// ...
|
||||
/// sfShader_setTextureUniform(shader, "the_texture", &texture);
|
||||
/// \endcode
|
||||
/// It is important to note that \a texture must remain alive as long
|
||||
/// as the shader uses it, no copy is made internally.
|
||||
///
|
||||
/// To use the texture of the object being drawn, which cannot be
|
||||
/// known in advance, you can pass the special value
|
||||
/// sf::Shader::CurrentTexture:
|
||||
/// \code
|
||||
/// shader.setUniform("the_texture", sf::Shader::CurrentTexture).
|
||||
/// \endcode
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the texture in the shader
|
||||
/// \param texture Texture to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setTextureUniform(sfShader* shader, const char* name, const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify current texture as \p sampler2D uniform
|
||||
///
|
||||
/// This overload maps a shader texture variable to the
|
||||
/// texture of the object being drawn, which cannot be
|
||||
/// known in advance.
|
||||
/// The corresponding parameter in the shader must be a 2D texture
|
||||
/// (\p sampler2D GLSL type).
|
||||
///
|
||||
/// Example:
|
||||
/// \code
|
||||
/// uniform sampler2D current; // this is the variable in the shader
|
||||
/// \endcode
|
||||
/// \code
|
||||
/// sfShader_setCurrentTextureUniform(shader, "current");
|
||||
/// \endcode
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the texture in the shader
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setCurrentTextureUniform(sfShader* shader, const char* name);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p float[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param scalarArray pointer to array of \p float values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloatUniformArray(sfShader* shader, const char* name, const float* scalarArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p vec2[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vectorArray pointer to array of \p vec2 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec2UniformArray(sfShader* shader, const char* name, const sfGlslVec2* vectorArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p vec3[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vectorArray pointer to array of \p vec3 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec3UniformArray(sfShader* shader, const char* name, const sfGlslVec3* vectorArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p vec4[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vectorArray pointer to array of \p vec4 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec4UniformArray(sfShader* shader, const char* name, const sfGlslVec4* vectorArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p mat3[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrixArray pointer to array of \p mat3 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat3UniformArray(sfShader* shader, const char* name, const sfGlslMat3* matrixArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p mat4[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrixArray pointer to array of \p mat4 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat4UniformArray(sfShader* shader, const char* name, const sfGlslMat4* matrixArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a float parameter of a shader
|
||||
///
|
||||
@@ -122,7 +418,7 @@ CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
|
||||
/// \param x Value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 2-components vector parameter of a shader
|
||||
@@ -145,7 +441,7 @@ CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char*
|
||||
/// \param y Second component of the value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 3-components vector parameter of a shader
|
||||
@@ -169,7 +465,7 @@ CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char
|
||||
/// \param z Third component of the value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 4-components vector parameter of a shader
|
||||
@@ -194,7 +490,7 @@ CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char
|
||||
/// \param w Fourth component of the value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 2-components vector parameter of a shader
|
||||
@@ -217,7 +513,7 @@ CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char
|
||||
/// \param vector Vector to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 3-components vector parameter of a shader
|
||||
@@ -240,7 +536,7 @@ CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const cha
|
||||
/// \param vector Vector to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a color parameter of a shader
|
||||
@@ -268,7 +564,7 @@ CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const cha
|
||||
/// \param color Color to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a matrix parameter of a shader
|
||||
@@ -291,7 +587,7 @@ CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char*
|
||||
/// \param transform Transform to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a texture parameter of a shader
|
||||
@@ -324,7 +620,7 @@ CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const c
|
||||
/// \param texture Texture to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a texture parameter of a shader
|
||||
@@ -347,7 +643,21 @@ CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const cha
|
||||
/// \param name Name of the texture in the shader
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the shader.
|
||||
///
|
||||
/// You shouldn't need to use this function, unless you have
|
||||
/// very specific stuff to implement that SFML doesn't support,
|
||||
/// or implement a temporary workaround until a bug is fixed.
|
||||
///
|
||||
/// \param shader Shader object
|
||||
///
|
||||
/// \return OpenGL handle of the shader or 0 if not yet loaded
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfShader_getNativeHandle(const sfShader* shader);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Bind a shader for rendering (activate it)
|
||||
@@ -384,5 +694,23 @@ CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not the system supports geometry shaders
|
||||
///
|
||||
/// This function should always be called before using
|
||||
/// the geometry shader features. If it returns false, then
|
||||
/// any attempt to use sfShader geometry shader features will fail.
|
||||
///
|
||||
/// This function can only return true if isAvailable() would also
|
||||
/// return true, since shaders in general have to be supported in
|
||||
/// order for geometry shaders to be supported as well.
|
||||
///
|
||||
/// Note: The first call to this function, whether by your
|
||||
/// code or SFML will result in a context switch.
|
||||
///
|
||||
/// \return True if geometry shaders are supported, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfShader_isGeometryAvailable(void);
|
||||
|
||||
#endif // SFML_SHADER_H
|
||||
@@ -34,10 +34,11 @@
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
typedef unsigned int (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape
|
||||
typedef sfVector2f (*sfShapeGetPointCallback)(unsigned int, void*); ///< Type of the callback used to get a point of a shape
|
||||
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
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a new shape
|
||||
@@ -56,7 +57,7 @@ CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPoint
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShape_destroy(sfShape* shape);
|
||||
@@ -351,7 +352,7 @@ CSFML_GRAPHICS_API float sfShape_getOutlineThickness(const sfShape* shape);
|
||||
/// \return Number of points of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape);
|
||||
CSFML_GRAPHICS_API size_t sfShape_getPointCount(const sfShape* shape);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get a point of a shape
|
||||
@@ -364,7 +365,7 @@ CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape);
|
||||
/// \return Index-th point of the shape
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index);
|
||||
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, size_t index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the local bounding rectangle of a shape
|
||||
|
||||
@@ -290,16 +290,60 @@ CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size)
|
||||
CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the global color of a text
|
||||
/// \brief Set the fill color of a text
|
||||
///
|
||||
/// By default, the text's color is opaque white.
|
||||
/// By default, the text's fill color is opaque white.
|
||||
/// Setting the fill color to a transparent color with an outline
|
||||
/// will cause the outline to be displayed in the fill area of the text.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param color New color of the text
|
||||
/// \param color New fill color of the text
|
||||
///
|
||||
/// \deprecated This function is deprecated and may be removed in future releases.
|
||||
/// Use sfText_setFillColor instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the fill color of a text
|
||||
///
|
||||
/// By default, the text's fill color is opaque white.
|
||||
/// Setting the fill color to a transparent color with an outline
|
||||
/// will cause the outline to be displayed in the fill area of the text.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param color New fill color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setFillColor(sfText* text, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the outline color of the text
|
||||
///
|
||||
/// By default, the text's outline color is opaque black.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param color New outline color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setOutlineColor(sfText* text, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the thickness of the text's outline
|
||||
///
|
||||
/// By default, the outline thickness is 0.
|
||||
///
|
||||
/// Be aware that using a negative value for the outline
|
||||
/// thickness will cause distorted rendering.
|
||||
///
|
||||
/// \param thickness New outline thickness, in pixels
|
||||
///
|
||||
/// \see getOutlineThickness
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setOutlineThickness(sfText* text, float thickness);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the string of a text (returns an ANSI string)
|
||||
///
|
||||
@@ -355,15 +399,48 @@ CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text);
|
||||
CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the global color of a text
|
||||
/// \brief Get the fill color of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Global color of the text
|
||||
/// \return Fill color of the text
|
||||
///
|
||||
/// \deprecated This function is deprecated and may be removed in future releases.
|
||||
/// Use sfText_getFillColor instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfText_getColor(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the fill color of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Fill color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfText_getFillColor(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the outline color of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Outline color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfText_getOutlineColor(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the outline thickness of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Outline thickness of a text, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfText_getOutlineThickness(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Return the position of the \a index-th character in a text
|
||||
///
|
||||
|
||||
@@ -196,6 +196,41 @@ CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable conversion from sRGB
|
||||
///
|
||||
/// When providing texture data from an image file or memory, it can
|
||||
/// either be stored in a linear color space or an sRGB color space.
|
||||
/// Most digital images account for gamma correction already, so they
|
||||
/// would need to be "uncorrected" back to linear color space before
|
||||
/// being processed by the hardware. The hardware can automatically
|
||||
/// convert it from the sRGB color space to a linear color space when
|
||||
/// it gets sampled. When the rendered image gets output to the final
|
||||
/// framebuffer, it gets converted back to sRGB.
|
||||
///
|
||||
/// After enabling or disabling sRGB conversion, make sure to reload
|
||||
/// the texture data in order for the setting to take effect.
|
||||
///
|
||||
/// This option is only useful in conjunction with an sRGB capable
|
||||
/// framebuffer. This can be requested during window creation.
|
||||
///
|
||||
/// \param sRgb True to enable sRGB conversion, false to disable it
|
||||
///
|
||||
/// \see sfTexture_isSrgb
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTexture_setSrgb(sfTexture* texture, sfBool sRgb);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether the texture source is converted from sRGB or not
|
||||
///
|
||||
/// \return True if the texture source is converted from sRGB, false if not
|
||||
///
|
||||
/// \see sfTexture_setSrgb
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable repeating for a texture
|
||||
///
|
||||
@@ -229,6 +264,45 @@ CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeate
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Generate a mipmap using the current texture data
|
||||
///
|
||||
/// Mipmaps are pre-computed chains of optimized textures. Each
|
||||
/// level of texture in a mipmap is generated by halving each of
|
||||
/// the previous level's dimensions. This is done until the final
|
||||
/// level has the size of 1x1. The textures generated in this process may
|
||||
/// make use of more advanced filters which might improve the visual quality
|
||||
/// of textures when they are applied to objects much smaller than they are.
|
||||
/// This is known as minification. Because fewer texels (texture elements)
|
||||
/// have to be sampled from when heavily minified, usage of mipmaps
|
||||
/// can also improve rendering performance in certain scenarios.
|
||||
///
|
||||
/// Mipmap generation relies on the necessary OpenGL extension being
|
||||
/// available. If it is unavailable or generation fails due to another
|
||||
/// reason, this function will return false. Mipmap data is only valid from
|
||||
/// the time it is generated until the next time the base level image is
|
||||
/// modified, at which point this function will have to be called again to
|
||||
/// regenerate it.
|
||||
///
|
||||
/// \return sfTrue if mipmap generation was successful, sfFalse if unsuccessful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the texture.
|
||||
///
|
||||
/// You shouldn't need to use this function, unless you have
|
||||
/// very specific stuff to implement that SFML doesn't support,
|
||||
/// or implement a temporary workaround until a bug is fixed.
|
||||
///
|
||||
/// \param texture The texture object
|
||||
///
|
||||
/// \return OpenGL handle of the texture or 0 if not yet created
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfTexture_getNativeHandle(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Bind a texture for rendering
|
||||
///
|
||||
|
||||
@@ -139,7 +139,7 @@ CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect(const sfTransform* tran
|
||||
/// equivalent to a matrix multiplication.
|
||||
///
|
||||
/// \param transform Transform object
|
||||
/// \param right Transform to combine to \a transform
|
||||
/// \param other Transform to combine to \a transform
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTransform_combine(sfTransform* transform, const sfTransform* other);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <SFML/Graphics/Rect.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/Graphics/Vertex.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -69,7 +70,7 @@ CSFML_GRAPHICS_API void sfVertexArray_destroy(sfVertexArray* vertexArray);
|
||||
/// \return Number of vertices in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray);
|
||||
CSFML_GRAPHICS_API size_t sfVertexArray_getVertexCount(const sfVertexArray* vertexArray);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get access to a vertex by its index
|
||||
@@ -84,7 +85,7 @@ CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray
|
||||
/// \return Pointer to the index-th vertex
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index);
|
||||
CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, size_t index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Clear a vertex array
|
||||
@@ -112,7 +113,7 @@ CSFML_GRAPHICS_API void sfVertexArray_clear(sfVertexArray* vertexArray);
|
||||
/// \param vertexCount New size of the array (number of vertices)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount);
|
||||
CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, size_t vertexCount);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Add a vertex to a vertex array array
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <SFML/Network/IpAddress.h>
|
||||
#include <SFML/Network/Packet.h>
|
||||
#include <SFML/Network/SocketSelector.h>
|
||||
#include <SFML/Network/SocketStatus.h>
|
||||
#include <SFML/Network/TcpListener.h>
|
||||
#include <SFML/Network/TcpSocket.h>
|
||||
#include <SFML/Network/UdpSocket.h>
|
||||
|
||||
@@ -332,7 +332,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp);
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* name, const char* password);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Close the connection with the server
|
||||
@@ -486,7 +486,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name);
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* localPath, sfFtpTransferMode mode);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Upload a file to a FTP server
|
||||
@@ -504,7 +504,27 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantF
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a command to the FTP server
|
||||
///
|
||||
/// While the most often used commands are provided as
|
||||
/// specific functions, this function can be used to send
|
||||
/// any FTP command to the server. If the command requires
|
||||
/// one or more parameters, they can be specified in
|
||||
/// \a parameter. Otherwise you should pass NULL.
|
||||
/// If the server returns information, you can extract it
|
||||
/// from the response using sfResponse_getMessage().
|
||||
///
|
||||
/// \param ftp Ftp object
|
||||
/// \param command Command to send
|
||||
/// \param parameter Command parameter
|
||||
///
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_sendCommand(sfFtp* ftp, const char* command, const char* parameter);
|
||||
|
||||
|
||||
#endif // SFML_FTP_H
|
||||
@@ -48,6 +48,12 @@ typedef struct
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API const sfIpAddress sfIpAddress_None;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Value representing any address (0.0.0.0)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API const sfIpAddress sfIpAddress_Any;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Local host IP address (127.0.0.1, or "localhost")
|
||||
///
|
||||
@@ -114,8 +120,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address);
|
||||
/// from a host name.
|
||||
///
|
||||
/// \param address Address object
|
||||
///
|
||||
/// \return String representation of the address
|
||||
/// \param string String where the string representation will be stored
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string);
|
||||
|
||||
@@ -34,6 +34,7 @@ typedef enum
|
||||
{
|
||||
sfSocketDone, ///< The socket has sent / received the data
|
||||
sfSocketNotReady, ///< The socket is not ready to send / receive data yet
|
||||
sfSocketPartial, ///< The socket sent a part of the data
|
||||
sfSocketDisconnected, ///< The TCP socket has been disconnected
|
||||
sfSocketError ///< An unexpected error happened
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Network/Export.h>
|
||||
#include <SFML/Network/SocketStatus.h>
|
||||
#include <SFML/Network/IpAddress.h>
|
||||
#include <SFML/Network/Types.h>
|
||||
|
||||
|
||||
@@ -98,13 +99,16 @@ CSFML_NETWORK_API unsigned short sfTcpListener_getLocalPort(const sfTcpListener*
|
||||
/// If the socket was previously listening to another port,
|
||||
/// it will be stopped first and bound to the new port.
|
||||
///
|
||||
/// If there is no specific address to listen to, pass sfIpAddress_Any
|
||||
///
|
||||
/// \param listener TCP listener object
|
||||
/// \param port Port to listen for new connections
|
||||
/// \param address Address of the interface to listen on
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port, sfIpAddress address);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Accept a new connection
|
||||
|
||||
@@ -134,7 +134,7 @@ CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* so
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, 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
|
||||
@@ -150,6 +150,9 @@ CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send raw data to the remote peer of a TCP socket
|
||||
///
|
||||
/// To be able to handle partial sends over non-blocking
|
||||
/// sockets, use the sfTcpSocket_sendPartial(sfTcpSocket*, const void*, std::size_t, size_t*)
|
||||
/// overload instead.
|
||||
/// This function will fail if the socket is not connected.
|
||||
///
|
||||
/// \param socket TCP socket object
|
||||
@@ -161,6 +164,21 @@ CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send raw data to the remote peer
|
||||
///
|
||||
/// This function will fail if the socket is not connected.
|
||||
///
|
||||
/// \param socket TCP socket object
|
||||
/// \param data Pointer to the sequence of bytes to send
|
||||
/// \param size Number of bytes to send
|
||||
/// \param sent The number of bytes sent will be written here
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPartial(sfTcpSocket* socket, const void* data, size_t size, size_t* sent);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive raw data from the remote peer of a TCP socket
|
||||
///
|
||||
@@ -176,11 +194,15 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const voi
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t size, size_t* received);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to the remote peer of a TCP socket
|
||||
///
|
||||
/// In non-blocking mode, if this function returns sfSocketPartial,
|
||||
/// you must retry sending the same unmodified packet before sending
|
||||
/// anything else in order to guarantee the packet arrives at the remote
|
||||
/// peer uncorrupted.
|
||||
/// This function will fail if the socket is not connected.
|
||||
///
|
||||
/// \param socket TCP socket object
|
||||
|
||||
@@ -101,13 +101,16 @@ CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* soc
|
||||
/// system to automatically pick an available port, and then
|
||||
/// call sfUdpSocket_getLocalPort to retrieve the chosen port.
|
||||
///
|
||||
/// \param socket UDP socket object
|
||||
/// \param port Port to bind the socket to
|
||||
/// If there is no specific address to listen to, pass sfIpAddress_Any
|
||||
///
|
||||
/// \param socket UDP socket object
|
||||
/// \param port Port to bind the socket to
|
||||
/// \param address Address of the interface to bind to
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port, sfIpAddress address);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Unbind a UDP socket from the local port to which it is bound
|
||||
@@ -137,7 +140,7 @@ 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 address, unsigned short port);
|
||||
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
|
||||
@@ -159,7 +162,7 @@ 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 maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
|
||||
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
|
||||
@@ -176,7 +179,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void*
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port);
|
||||
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
|
||||
@@ -191,7 +194,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfP
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port);
|
||||
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
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <SFML/System/Mutex.h>
|
||||
#include <SFML/System/Sleep.h>
|
||||
#include <SFML/System/Thread.h>
|
||||
#include <SFML/System/Time.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <SFML/System/Vector3.h>
|
||||
|
||||
|
||||
@@ -33,8 +33,11 @@
|
||||
#include <SFML/Window/Context.h>
|
||||
#include <SFML/Window/Event.h>
|
||||
#include <SFML/Window/Joystick.h>
|
||||
#include <SFML/Window/JoystickIdentification.h>
|
||||
#include <SFML/Window/Keyboard.h>
|
||||
#include <SFML/Window/Mouse.h>
|
||||
#include <SFML/Window/Sensor.h>
|
||||
#include <SFML/Window/Touch.h>
|
||||
#include <SFML/Window/VideoMode.h>
|
||||
#include <SFML/Window/Window.h>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Export.h>
|
||||
#include <SFML/Window/Types.h>
|
||||
|
||||
#include <SFML/Window/Window.h>
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a new context
|
||||
@@ -56,8 +56,21 @@ CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
|
||||
/// \param context Context object
|
||||
/// \param active sfTrue to activate, sfFalse to deactivate
|
||||
///
|
||||
/// \return sfTrue on success, sfFalse on failure
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfContext_setActive(sfContext* context, sfBool active);
|
||||
CSFML_WINDOW_API sfBool sfContext_setActive(sfContext* context, sfBool active);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the settings of the context.
|
||||
///
|
||||
/// Note that these settings may be different than the ones passed to the
|
||||
/// constructor; they are indeed adjusted if the original settings are not
|
||||
/// directly supported by the system.
|
||||
///
|
||||
/// \return Structure containing the settings
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfContextSettings sfContext_getSettings(const sfContext* context);
|
||||
|
||||
#endif // SFML_CONTEXT_H
|
||||
+32
-14
@@ -48,7 +48,8 @@ typedef enum
|
||||
sfEvtTextEntered, ///< A character was entered (data in event.text)
|
||||
sfEvtKeyPressed, ///< A key was pressed (data in event.key)
|
||||
sfEvtKeyReleased, ///< A key was released (data in event.key)
|
||||
sfEvtMouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel)
|
||||
sfEvtMouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel) (deprecated)
|
||||
sfEvtMouseWheelScrolled, ///< The mouse wheel was scrolled (data in event.mouseWheelScroll)
|
||||
sfEvtMouseButtonPressed, ///< A mouse button was pressed (data in event.mouseButton)
|
||||
sfEvtMouseButtonReleased, ///< A mouse button was released (data in event.mouseButton)
|
||||
sfEvtMouseMoved, ///< The mouse cursor moved (data in event.mouseMove)
|
||||
@@ -118,8 +119,11 @@ typedef struct
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Mouse wheel events parameters
|
||||
///
|
||||
/// \deprecated
|
||||
/// Use sfMouseWheelScrollEvent instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
typedef struct CSFML_DEPRECATED
|
||||
{
|
||||
sfEventType type;
|
||||
int delta;
|
||||
@@ -127,6 +131,19 @@ typedef struct
|
||||
int y;
|
||||
} sfMouseWheelEvent;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Mouse wheel events parameters
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
{
|
||||
sfEventType type;
|
||||
sfMouseWheel wheel;
|
||||
float delta;
|
||||
int x;
|
||||
int y;
|
||||
} sfMouseWheelScrollEvent;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Joystick axis move event parameters
|
||||
///
|
||||
@@ -202,18 +219,19 @@ typedef struct
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef union
|
||||
{
|
||||
sfEventType type; ///< Type of the event
|
||||
sfSizeEvent size; ///< Size event parameters
|
||||
sfKeyEvent key; ///< Key event parameters
|
||||
sfTextEvent text; ///< Text event parameters
|
||||
sfMouseMoveEvent mouseMove; ///< Mouse move event parameters
|
||||
sfMouseButtonEvent mouseButton; ///< Mouse button event parameters
|
||||
sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters
|
||||
sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters
|
||||
sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters
|
||||
sfJoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters
|
||||
sfTouchEvent touch; ///< Touch events parameters
|
||||
sfSensorEvent sensor; ///< Sensor event parameters
|
||||
sfEventType type; ///< Type of the event
|
||||
sfSizeEvent size; ///< Size event parameters
|
||||
sfKeyEvent key; ///< Key event parameters
|
||||
sfTextEvent text; ///< Text event parameters
|
||||
sfMouseMoveEvent mouseMove; ///< Mouse move event parameters
|
||||
sfMouseButtonEvent mouseButton; ///< Mouse button event parameters
|
||||
sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (deprecated)
|
||||
sfMouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters
|
||||
sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters
|
||||
sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters
|
||||
sfJoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters
|
||||
sfTouchEvent touch; ///< Touch events parameters
|
||||
sfSensorEvent sensor; ///< Sensor event parameters
|
||||
} sfEvent;
|
||||
|
||||
|
||||
|
||||
@@ -154,5 +154,18 @@ typedef enum
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the virtual keyboard.
|
||||
///
|
||||
/// Warning: the virtual keyboard is not supported on all systems.
|
||||
/// It will typically be implemented on mobile OSes (Android, iOS)
|
||||
/// but not on desktop OSes (Windows, Linux, ...).
|
||||
///
|
||||
/// If the virtual keyboard is not available, this function does nothing.
|
||||
///
|
||||
/// \param visible True to show, false to hide
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(sfBool visible);
|
||||
|
||||
#endif // SFML_KEYBOARD_H
|
||||
@@ -48,6 +48,16 @@ typedef enum
|
||||
sfMouseButtonCount ///< Keep last -- the total number of mouse buttons
|
||||
} sfMouseButton;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Mouse wheels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
sfMouseVerticalWheel, ///< The vertical mouse wheel
|
||||
sfMouseHorizontalWheel ///< The horizontal mouse wheel
|
||||
} sfMouseWheel;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Check if a mouse button is pressed
|
||||
|
||||
@@ -70,7 +70,7 @@ CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode(void);
|
||||
/// \return Pointer to an array containing all the supported fullscreen modes
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count);
|
||||
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not a video mode is valid
|
||||
|
||||
@@ -51,6 +51,18 @@ typedef enum
|
||||
} sfWindowStyle;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enumeration of the context attribute flags
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
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;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Structure defining the window's creation settings
|
||||
///
|
||||
@@ -62,6 +74,8 @@ typedef struct
|
||||
unsigned int antialiasingLevel; ///< Level of antialiasing
|
||||
unsigned int majorVersion; ///< Major number of the context version to create
|
||||
unsigned int minorVersion; ///< Minor number of the context version to create
|
||||
sfUint32 attributeFlags; ///< The attribute flags to create the context with
|
||||
sfBool sRgbCapable; ///< Whether the context framebuffer is sRGB capable
|
||||
} sfContextSettings;
|
||||
|
||||
|
||||
@@ -302,15 +316,6 @@ CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, uns
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the mouse cursor
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param visible sfTrue to show, sfFalse to hide
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable vertical synchronization
|
||||
///
|
||||
@@ -325,6 +330,30 @@ CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool vi
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the mouse cursor
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param visible sfTrue to show, sfFalse to hide
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Grab or release the mouse cursor
|
||||
///
|
||||
/// If set, grabs the mouse cursor inside this window's client
|
||||
/// area so it may no longer be moved outside its bounds.
|
||||
/// Note that grabbing is only active while the window has
|
||||
/// focus and calling this function for fullscreen windows
|
||||
/// won't have any effect (fullscreen windows always grab the
|
||||
/// cursor).
|
||||
///
|
||||
/// \param grabbed sfTrue to enable, sfFalse to disable
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable automatic key-repeat
|
||||
///
|
||||
@@ -340,6 +369,31 @@ CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool e
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency
|
||||
///
|
||||
/// If a limit is set, the window will use a small delay after
|
||||
/// each call to sfWindow_display to ensure that the current frame
|
||||
/// lasted long enough to match the framerate limit.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold
|
||||
///
|
||||
/// The joystick threshold is the value below which
|
||||
/// no JoyMoved event will be generated.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param threshold New threshold, in the range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Activate or deactivate a window as the current target
|
||||
/// for OpenGL rendering
|
||||
@@ -398,31 +452,6 @@ CSFML_WINDOW_API sfBool sfWindow_hasFocus(const sfWindow* window);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_display(sfWindow* window);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency
|
||||
///
|
||||
/// If a limit is set, the window will use a small delay after
|
||||
/// each call to sfWindow_display to ensure that the current frame
|
||||
/// lasted long enough to match the framerate limit.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold
|
||||
///
|
||||
/// The joystick threshold is the value below which
|
||||
/// no JoyMoved event will be generated.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param threshold New threshold, in the range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the OS-specific handle of the window
|
||||
///
|
||||
|
||||
+8
-7
@@ -1,20 +1,21 @@
|
||||
CSFML - Simple and Fast Multimedia Library for C
|
||||
================================================
|
||||
|
||||
SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics,
|
||||
audio and network.
|
||||
SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing,
|
||||
graphics, audio and network.
|
||||
It is originally written in C++, and this project is its official binding for the C language.
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
Laurent Gomila - main developer (laurent@sfml-dev.org)
|
||||
Zachariah Brown - active maintainer (contact@zbrown.net)
|
||||
|
||||
Download
|
||||
--------
|
||||
|
||||
You can get the latest official release on SFML website (http://www.sfml-dev.org/download/csfml).
|
||||
You can also get the current development version from the git repository (https://github.com/LaurentGomila/CSFML).
|
||||
You can also get the current development version from the git repository (https://github.com/SFML/CSFML).
|
||||
|
||||
Learn
|
||||
-----
|
||||
@@ -22,10 +23,10 @@ Learn
|
||||
There is no tutorial for CSFML, but since it's a binding you can use the C++ resources:
|
||||
* The official tutorials (http://www.sfml-dev.org/tutorials/)
|
||||
* The online API documentation (http://www.sfml-dev.org/documentation/)
|
||||
* The community wiki (https://github.com/LaurentGomila/SFML/wiki/)
|
||||
* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for french people)
|
||||
* The community wiki (https://github.com/SFML/SFML/wiki/)
|
||||
* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for French people)
|
||||
|
||||
Of course, you can also find the CSFM API documentation in the SDK.
|
||||
Of course, you can also find the CSFML API documentation in the SDK.
|
||||
|
||||
Building
|
||||
--------
|
||||
@@ -37,5 +38,5 @@ Contribute
|
||||
|
||||
SFML and CSFML are open-source projects, and they need your help to go on growing and improving.
|
||||
Don't hesitate to post suggestions or bug reports on the forum (http://en.sfml-dev.org/forums/),
|
||||
submit patches by e-mail, or post new bugs/features requests on the task tracker (https://github.com/LaurentGomila/CSFML/issues/).
|
||||
or post new bugs/features requests on the task tracker (https://github.com/SFML/CSFML/issues/).
|
||||
You can even fork the project on GitHub, maintain your own version and send us pull requests periodically to merge your work.
|
||||
@@ -80,7 +80,7 @@ sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
|
||||
sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate)
|
||||
{
|
||||
sfSoundBuffer* buffer = new sfSoundBuffer;
|
||||
|
||||
@@ -125,7 +125,7 @@ const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer)
|
||||
sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBuffer, getSampleCount(), 0);
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
|
||||
sfBool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
|
||||
{
|
||||
CSFML_CALL(soundBufferRecorder, start(sampleRate));
|
||||
CSFML_CALL_RETURN(soundBufferRecorder, start(sampleRate), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,3 +74,19 @@ const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder
|
||||
|
||||
return &soundBufferRecorder->SoundBuffer;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBufferRecorder, setDevice(name), sfFalse);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfSoundBufferRecorder_getDevice(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
{
|
||||
CSFML_CHECK_RETURN(soundBufferRecorder, NULL);
|
||||
|
||||
soundBufferRecorder->DeviceName = soundBufferRecorder->This.getDevice();
|
||||
|
||||
return soundBufferRecorder->DeviceName.c_str();
|
||||
}
|
||||
@@ -39,6 +39,7 @@ struct sfSoundBufferRecorder
|
||||
{
|
||||
sf::SoundBufferRecorder This;
|
||||
mutable sfSoundBuffer SoundBuffer;
|
||||
std::string DeviceName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ const char** sfSoundRecorder_getAvailableDevices(size_t* count)
|
||||
return !cstringDevices.empty() ? &cstringDevices[0] : NULL;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfSoundRecorder_getDefaultDevice()
|
||||
{
|
||||
@@ -110,12 +111,14 @@ const char* sfSoundRecorder_getDefaultDevice()
|
||||
return !defaultDevice.empty() ? defaultDevice.c_str() : NULL;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundRecorder, setDevice(name), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
@@ -125,3 +128,17 @@ const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
||||
|
||||
return soundRecorder->DeviceName.c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundRecorder_setChannelCount(sfSoundRecorder* soundRecorder, unsigned int channelCount)
|
||||
{
|
||||
CSFML_CALL(soundRecorder, setChannelCount(channelCount));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundRecorder_getChannelCount(const sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundRecorder, getChannelCount(), 0);
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Define a function to convert a sf::Event ot a sfEvent
|
||||
// Define a function to convert a sf::Event to a sfEvent
|
||||
////////////////////////////////////////////////////////////
|
||||
inline void convertEvent(const sf::Event& SFMLEvent, sfEvent* event)
|
||||
{
|
||||
@@ -67,6 +67,13 @@ inline void convertEvent(const sf::Event& SFMLEvent, sfEvent* event)
|
||||
event->mouseWheel.y = SFMLEvent.mouseWheel.y;
|
||||
break;
|
||||
|
||||
case sfEvtMouseWheelScrolled :
|
||||
event->mouseWheelScroll.wheel = static_cast<sfMouseWheel>(SFMLEvent.mouseWheelScroll.wheel);
|
||||
event->mouseWheelScroll.delta = SFMLEvent.mouseWheelScroll.delta;
|
||||
event->mouseWheelScroll.x = SFMLEvent.mouseWheelScroll.x;
|
||||
event->mouseWheelScroll.y = SFMLEvent.mouseWheelScroll.y;
|
||||
break;
|
||||
|
||||
case sfEvtMouseButtonPressed :
|
||||
case sfEvtMouseButtonReleased :
|
||||
event->mouseButton.button = static_cast<sfMouseButton>(SFMLEvent.mouseButton.button);
|
||||
|
||||
@@ -277,14 +277,14 @@ float sfCircleShape_getOutlineThickness(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape)
|
||||
size_t sfCircleShape_getPointCount(const sfCircleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index)
|
||||
sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, size_t index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
@@ -312,7 +312,7 @@ float sfCircleShape_getRadius(const sfCircleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count)
|
||||
void sfCircleShape_setPointCount(sfCircleShape* shape, size_t count)
|
||||
{
|
||||
CSFML_CALL(shape, setPointCount(count));
|
||||
}
|
||||
|
||||
@@ -63,6 +63,25 @@ sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_fromInteger(sfUint32 color)
|
||||
{
|
||||
sfUint8 red = (color & 0xff000000) >> 24;
|
||||
sfUint8 green = (color & 0x00ff0000) >> 16;
|
||||
sfUint8 blue = (color & 0x0000ff00) >> 8;
|
||||
sfUint8 alpha = (color & 0x000000ff) >> 0;
|
||||
|
||||
return sfColor_fromRGBA(red, green, blue, alpha);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfUint32 sfColor_toInteger(sfColor color)
|
||||
{
|
||||
return (color.r << 24) | (color.g << 16) | (color.b << 8) | color.a;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_add(sfColor color1, sfColor color2)
|
||||
{
|
||||
@@ -78,6 +97,21 @@ sfColor sfColor_add(sfColor color1, sfColor color2)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_subtract(sfColor color1, sfColor color2)
|
||||
{
|
||||
int red = std::max(color1.r - color2.r, 0);
|
||||
int green = std::max(color1.g - color2.g, 0);
|
||||
int blue = std::max(color1.b - color2.b, 0);
|
||||
int alpha = std::max(color1.a - color2.a, 0);
|
||||
|
||||
return sfColor_fromRGBA(static_cast<sfUint8>(red),
|
||||
static_cast<sfUint8>(green),
|
||||
static_cast<sfUint8>(blue),
|
||||
static_cast<sfUint8>(alpha));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_modulate(sfColor color1, sfColor color2)
|
||||
{
|
||||
|
||||
@@ -274,14 +274,14 @@ float sfConvexShape_getOutlineThickness(const sfConvexShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape)
|
||||
size_t sfConvexShape_getPointCount(const sfConvexShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index)
|
||||
sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, size_t index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
@@ -295,14 +295,14 @@ sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count)
|
||||
void sfConvexShape_setPointCount(sfConvexShape* shape, size_t count)
|
||||
{
|
||||
CSFML_CALL(shape, setPointCount(count));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point)
|
||||
void sfConvexShape_setPoint(sfConvexShape* shape, size_t index, sfVector2f point)
|
||||
{
|
||||
CSFML_CALL(shape, setPoint(index, sf::Vector2f(point.x, point.y)));
|
||||
}
|
||||
|
||||
@@ -93,12 +93,12 @@ void sfFont_destroy(sfFont* font)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold)
|
||||
sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness)
|
||||
{
|
||||
sfGlyph glyph = {0, {0, 0, 0, 0}, {0, 0, 0, 0}};
|
||||
CSFML_CHECK_RETURN(font, glyph);
|
||||
|
||||
sf::Glyph SFMLGlyph = font->This.getGlyph(codePoint, characterSize, bold == sfTrue);
|
||||
sf::Glyph SFMLGlyph = font->This.getGlyph(codePoint, characterSize, bold == sfTrue, outlineThickness);
|
||||
|
||||
glyph.advance = SFMLGlyph.advance;
|
||||
glyph.bounds.left = SFMLGlyph.bounds.left;
|
||||
|
||||
@@ -274,14 +274,14 @@ float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape)
|
||||
size_t sfRectangleShape_getPointCount(const sfRectangleShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index)
|
||||
sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, size_t index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
|
||||
@@ -218,7 +218,7 @@ void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVer
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
const sfVertex* vertices, size_t vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CALL(renderTexture, draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount,
|
||||
@@ -280,4 +280,11 @@ void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated
|
||||
sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL_RETURN(renderTexture, isRepeated(), sfFalse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture)
|
||||
{
|
||||
CSFML_CALL_RETURN(renderTexture, generateMipmap(), sfFalse);
|
||||
}
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <SFML/Graphics/ConvertRenderStates.hpp>
|
||||
#include <SFML/Window/Touch.hpp>
|
||||
#include <SFML/Internal.h>
|
||||
#include <SFML/Window/ContextSettingsInternal.h>
|
||||
#include <SFML/ConvertEvent.h>
|
||||
|
||||
|
||||
@@ -51,11 +52,7 @@ sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUin
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
priv::sfContextSettings_writeToCpp(*settings, params);
|
||||
}
|
||||
|
||||
// Create the window
|
||||
@@ -77,11 +74,7 @@ sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* t
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
priv::sfContextSettings_writeToCpp(*settings, params);
|
||||
}
|
||||
|
||||
// Create the window
|
||||
@@ -101,11 +94,7 @@ sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfC
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
priv::sfContextSettings_writeToCpp(*settings, params);
|
||||
}
|
||||
|
||||
// Create the window
|
||||
@@ -142,15 +131,11 @@ sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow)
|
||||
////////////////////////////////////////////////////////////
|
||||
sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow)
|
||||
{
|
||||
sfContextSettings settings = {0, 0, 0, 2, 0};
|
||||
sfContextSettings settings = priv::sfContextSettings_null();
|
||||
CSFML_CHECK_RETURN(renderWindow, settings);
|
||||
|
||||
const sf::ContextSettings& params = renderWindow->This.getSettings();
|
||||
settings.depthBits = params.depthBits;
|
||||
settings.stencilBits = params.stencilBits;
|
||||
settings.antialiasingLevel = params.antialiasingLevel;
|
||||
settings.majorVersion = params.majorVersion;
|
||||
settings.minorVersion = params.minorVersion;
|
||||
priv::sfContextSettings_readFromCpp(params, settings);
|
||||
|
||||
return settings;
|
||||
}
|
||||
@@ -268,6 +253,13 @@ void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled)
|
||||
{
|
||||
CSFML_CALL(renderWindow, setVerticalSyncEnabled(enabled == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool visible)
|
||||
{
|
||||
@@ -276,9 +268,9 @@ void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool v
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled)
|
||||
void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed)
|
||||
{
|
||||
CSFML_CALL(renderWindow, setVerticalSyncEnabled(enabled == sfTrue));
|
||||
CSFML_CALL(renderWindow, setMouseCursorGrabbed(grabbed == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
@@ -471,7 +463,7 @@ void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertex
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
|
||||
const sfVertex* vertices, unsigned int vertexCount,
|
||||
const sfVertex* vertices, size_t vertexCount,
|
||||
sfPrimitiveType type, const sfRenderStates* states)
|
||||
{
|
||||
CSFML_CALL(renderWindow, draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount,
|
||||
|
||||
+271
-52
@@ -34,26 +34,34 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename)
|
||||
sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename)
|
||||
{
|
||||
bool success = false;
|
||||
sfShader* shader = new sfShader;
|
||||
if (vertexShaderFilename || fragmentShaderFilename)
|
||||
if (vertexShaderFilename || geometryShaderFilename || fragmentShaderFilename)
|
||||
{
|
||||
if (!vertexShaderFilename)
|
||||
if (!geometryShaderFilename)
|
||||
{
|
||||
// fragment shader only
|
||||
success = shader->This.loadFromFile(fragmentShaderFilename, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShaderFilename)
|
||||
{
|
||||
// vertex shader only
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, sf::Shader::Vertex);
|
||||
if (!vertexShaderFilename)
|
||||
{
|
||||
// fragment shader only
|
||||
success = shader->This.loadFromFile(fragmentShaderFilename, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShaderFilename)
|
||||
{
|
||||
// vertex shader only
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, sf::Shader::Vertex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, fragmentShaderFilename);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, fragmentShaderFilename);
|
||||
// vertex + geometry + fragment shaders
|
||||
success = shader->This.loadFromFile(vertexShaderFilename, geometryShaderFilename, fragmentShaderFilename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,26 +76,34 @@ sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char*
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader)
|
||||
sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader)
|
||||
{
|
||||
bool success = false;
|
||||
sfShader* shader = new sfShader;
|
||||
if (vertexShader || fragmentShader)
|
||||
if (vertexShader || geometryShader || fragmentShader)
|
||||
{
|
||||
if (!vertexShader)
|
||||
if (!geometryShader)
|
||||
{
|
||||
// fragment shader only
|
||||
success = shader->This.loadFromMemory(fragmentShader, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShader)
|
||||
{
|
||||
// vertex shader only
|
||||
success = shader->This.loadFromMemory(vertexShader, sf::Shader::Vertex);
|
||||
if (!vertexShader)
|
||||
{
|
||||
// fragment shader only
|
||||
success = shader->This.loadFromMemory(fragmentShader, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShader)
|
||||
{
|
||||
// vertex shader only
|
||||
success = shader->This.loadFromMemory(vertexShader, sf::Shader::Vertex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
success = shader->This.loadFromMemory(vertexShader, fragmentShader);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
success = shader->This.loadFromMemory(vertexShader, fragmentShader);
|
||||
// vertex + geometry + fragment shaders
|
||||
success = shader->This.loadFromMemory(vertexShader, geometryShader, fragmentShader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,30 +118,41 @@ sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragme
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream)
|
||||
sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream)
|
||||
{
|
||||
bool success = false;
|
||||
sfShader* shader = new sfShader;
|
||||
if (vertexShaderStream || fragmentShaderStream)
|
||||
if (vertexShaderStream || geometryShaderStream || fragmentShaderStream)
|
||||
{
|
||||
if (!vertexShaderStream)
|
||||
if (!geometryShaderStream)
|
||||
{
|
||||
// fragment shader only
|
||||
CallbackStream stream(fragmentShaderStream);
|
||||
success = shader->This.loadFromStream(stream, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShaderStream)
|
||||
{
|
||||
// vertex shader only
|
||||
CallbackStream stream(vertexShaderStream);
|
||||
success = shader->This.loadFromStream(stream, sf::Shader::Vertex);
|
||||
if (!vertexShaderStream)
|
||||
{
|
||||
// fragment shader only
|
||||
CallbackStream stream(fragmentShaderStream);
|
||||
success = shader->This.loadFromStream(stream, sf::Shader::Fragment);
|
||||
}
|
||||
else if (!fragmentShaderStream)
|
||||
{
|
||||
// vertex shader only
|
||||
CallbackStream stream(vertexShaderStream);
|
||||
success = shader->This.loadFromStream(stream, sf::Shader::Vertex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
CallbackStream vertexStream(vertexShaderStream);
|
||||
CallbackStream fragmentStream(fragmentShaderStream);
|
||||
success = shader->This.loadFromStream(vertexStream, fragmentStream);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex + fragment shaders
|
||||
// vertex + geometry + fragment shaders
|
||||
CallbackStream vertexStream(vertexShaderStream);
|
||||
CallbackStream geometryStream(geometryShaderStream);
|
||||
CallbackStream fragmentStream(fragmentShaderStream);
|
||||
success = shader->This.loadFromStream(vertexStream, fragmentStream);
|
||||
success = shader->This.loadFromStream(vertexStream, geometryStream, fragmentStream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,90 +169,282 @@ sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputSt
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_destroy(sfShader* shader)
|
||||
{
|
||||
delete shader;
|
||||
delete shader;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setFloatUniform(sfShader* shader, const char* name, float x)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, x));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVec2Uniform(sfShader* shader, const char* name, sfGlslVec2 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Vec2(vector.x, vector.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVec3Uniform(sfShader* shader, const char* name, sfGlslVec3 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Vec3(vector.x, vector.y, vector.z)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVec4Uniform(sfShader* shader, const char* name, sfGlslVec4 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Vec4(vector.x, vector.y, vector.z, vector.w)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setColorUniform(sfShader* shader, const char* name, sfColor color)
|
||||
{
|
||||
sfGlslVec4 vec4;
|
||||
vec4.x = color.r / 255.f;
|
||||
vec4.y = color.g / 255.f;
|
||||
vec4.z = color.b / 255.f;
|
||||
vec4.w = color.a / 255.f;
|
||||
|
||||
sfShader_setVec4Uniform(shader, name, vec4);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setIntUniform(sfShader* shader, const char* name, int x)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, x));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setIvec2Uniform(sfShader* shader, const char* name, sfGlslIvec2 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Ivec2(vector.x, vector.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setIvec3Uniform(sfShader* shader, const char* name, sfGlslIvec3 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Ivec3(vector.x, vector.y, vector.z)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setIvec4Uniform(sfShader* shader, const char* name, sfGlslIvec4 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Ivec4(vector.x, vector.y, vector.z, vector.w)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor color)
|
||||
{
|
||||
sfGlslIvec4 ivec4;
|
||||
ivec4.x = (int)color.r;
|
||||
ivec4.y = (int)color.g;
|
||||
ivec4.z = (int)color.b;
|
||||
ivec4.w = (int)color.a;
|
||||
|
||||
sfShader_setIvec4Uniform(shader, name, ivec4);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setBoolUniform(sfShader* shader, const char* name, sfBool x)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, x != sfFalse));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setBvec2Uniform(sfShader* shader, const char* name, sfGlslBvec2 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec2(vector.x != sfFalse, vector.y != sfFalse)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setBvec3Uniform(sfShader* shader, const char* name, sfGlslBvec3 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec3(vector.x != sfFalse, vector.y != sfFalse, vector.z != sfFalse)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setBvec4Uniform(sfShader* shader, const char* name, sfGlslBvec4 vector)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Bvec4(vector.x != sfFalse, vector.y != sfFalse, vector.z != sfFalse, vector.w != sfFalse)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setMat3Uniform(sfShader* shader, const char* name, const sfGlslMat3* matrix)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Mat3(matrix->array)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setMat4Uniform(sfShader* shader, const char* name, const sfGlslMat4* matrix)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Glsl::Mat4(matrix->array)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setTextureUniform(sfShader* shader, const char* name, const sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, *texture->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setCurrentTextureUniform(sfShader* shader, const char* name)
|
||||
{
|
||||
CSFML_CALL(shader, setUniform(name, sf::Shader::CurrentTexture));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setFloatUniformArray(sfShader* shader, const char* name, const float* scalarArray, size_t length)
|
||||
{
|
||||
CSFML_CALL(shader, setUniformArray(name, scalarArray, length));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVec2UniformArray(sfShader* shader, const char* name, const sfGlslVec2* vectorArray, size_t length)
|
||||
{
|
||||
CSFML_CALL(shader, setUniformArray(name, reinterpret_cast<const sf::Glsl::Vec2*>(vectorArray), length));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVec3UniformArray(sfShader* shader, const char* name, const sfGlslVec3* vectorArray, size_t length)
|
||||
{
|
||||
CSFML_CALL(shader, setUniformArray(name, reinterpret_cast<const sf::Glsl::Vec3*>(vectorArray), length));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVec4UniformArray(sfShader* shader, const char* name, const sfGlslVec4* vectorArray, size_t length)
|
||||
{
|
||||
CSFML_CALL(shader, setUniformArray(name, reinterpret_cast<const sf::Glsl::Vec4*>(vectorArray), length));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setMat3UniformArray(sfShader* shader, const char* name, const sfGlslMat3* matrixArray, size_t length)
|
||||
{
|
||||
CSFML_CALL(shader, setUniformArray(name, reinterpret_cast<const sf::Glsl::Mat3*>(matrixArray), length));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setMat4UniformArray(sfShader* shader, const char* name, const sfGlslMat4* matrixArray, size_t length)
|
||||
{
|
||||
CSFML_CALL(shader, setUniformArray(name, reinterpret_cast<const sf::Glsl::Mat4*>(matrixArray), length));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setFloatParameter(sfShader* shader, const char* name, float x)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, x));
|
||||
CSFML_CALL(shader, setParameter(name, x));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, x, y));
|
||||
CSFML_CALL(shader, setParameter(name, x, y));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, x, y, z));
|
||||
CSFML_CALL(shader, setParameter(name, x, y, z));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, x, y, z, w));
|
||||
CSFML_CALL(shader, setParameter(name, x, y, z, w));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, sf::Vector2f(vector.x, vector.y)));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Vector2f(vector.x, vector.y)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, sf::Vector3f(vector.x, vector.y, vector.z)));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Vector3f(vector.x, vector.y, vector.z)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, sf::Color(color.r, color.g, color.b, color.a)));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, convertTransform(transform)));
|
||||
CSFML_CALL(shader, setParameter(name, convertTransform(transform)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture)
|
||||
{
|
||||
CSFML_CHECK(texture);
|
||||
CSFML_CALL(shader, setParameter(name, *texture->This));
|
||||
CSFML_CHECK(texture);
|
||||
CSFML_CALL(shader, setParameter(name,*texture->This));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name)
|
||||
{
|
||||
CSFML_CALL(shader, setParameter(name, sf::Shader::CurrentTexture));
|
||||
CSFML_CALL(shader, setParameter(name, sf::Shader::CurrentTexture));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfShader_getNativeHandle(const sfShader* shader)
|
||||
{
|
||||
CSFML_CALL_RETURN(shader, getNativeHandle(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfShader_bind(const sfShader* shader)
|
||||
{
|
||||
sf::Shader::bind(shader ? &shader->This : NULL);
|
||||
sf::Shader::bind(shader ? &shader->This : NULL);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfShader_isAvailable(void)
|
||||
{
|
||||
return sf::Shader::isAvailable() ? sfTrue : sfFalse;
|
||||
return sf::Shader::isAvailable() ? sfTrue : sfFalse;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfShader_isGeometryAvailable(void)
|
||||
{
|
||||
return sf::Shader::isGeometryAvailable() ? sfTrue : sfFalse;
|
||||
}
|
||||
@@ -267,14 +267,14 @@ float sfShape_getOutlineThickness(const sfShape* shape)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfShape_getPointCount(const sfShape* shape)
|
||||
size_t sfShape_getPointCount(const sfShape* shape)
|
||||
{
|
||||
CSFML_CALL_RETURN(shape, getPointCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index)
|
||||
sfVector2f sfShape_getPoint(const sfShape* shape, size_t index)
|
||||
{
|
||||
sfVector2f point = {0, 0};
|
||||
CSFML_CHECK_RETURN(shape, point);
|
||||
|
||||
@@ -51,12 +51,12 @@ public :
|
||||
{
|
||||
}
|
||||
|
||||
virtual unsigned int getPointCount() const
|
||||
virtual std::size_t getPointCount() const
|
||||
{
|
||||
return myGetPointCountCallback(myUserData);
|
||||
}
|
||||
|
||||
virtual sf::Vector2f getPoint(unsigned int index) const
|
||||
virtual sf::Vector2f getPoint(std::size_t index) const
|
||||
{
|
||||
sfVector2f point = myGetPointCallback(index, myUserData);
|
||||
return sf::Vector2f(point.x, point.y);
|
||||
|
||||
@@ -219,7 +219,28 @@ void sfText_setStyle(sfText* text, sfUint32 style)
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_setColor(sfText* text, sfColor color)
|
||||
{
|
||||
CSFML_CALL(text, setColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
sfText_setFillColor(text, color);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_setFillColor(sfText* text, sfColor color)
|
||||
{
|
||||
CSFML_CALL(text, setFillColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_setOutlineColor(sfText* text, sfColor color)
|
||||
{
|
||||
CSFML_CALL(text, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfText_setOutlineThickness(sfText* text, float thickness)
|
||||
{
|
||||
CSFML_CALL(text, setOutlineThickness(thickness));
|
||||
}
|
||||
|
||||
|
||||
@@ -268,11 +289,18 @@ sfUint32 sfText_getStyle(const sfText* text)
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfText_getColor(const sfText* text)
|
||||
{
|
||||
return sfText_getFillColor(text);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfText_getFillColor(const sfText* text)
|
||||
{
|
||||
sfColor color = {0, 0, 0, 0};
|
||||
CSFML_CHECK_RETURN(text, color);
|
||||
|
||||
sf::Color sfmlColor = text->This.getColor();
|
||||
sf::Color sfmlColor = text->This.getFillColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
@@ -282,6 +310,29 @@ sfColor sfText_getColor(const sfText* text)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfText_getOutlineColor(const sfText* text)
|
||||
{
|
||||
sfColor color = { 0, 0, 0, 0 };
|
||||
CSFML_CHECK_RETURN(text, color);
|
||||
|
||||
sf::Color sfmlColor = text->This.getOutlineColor();
|
||||
color.r = sfmlColor.r;
|
||||
color.g = sfmlColor.g;
|
||||
color.b = sfmlColor.b;
|
||||
color.a = sfmlColor.a;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfText_getOutlineThickness(const sfText* text)
|
||||
{
|
||||
CSFML_CALL_RETURN(text, getOutlineThickness(), 0.f);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2f sfText_findCharacterPos(const sfText* text, size_t index)
|
||||
{
|
||||
|
||||
@@ -225,6 +225,20 @@ sfBool sfTexture_isSmooth(const sfTexture* texture)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_setSrgb(sfTexture* texture, sfBool sRgb)
|
||||
{
|
||||
CSFML_CALL_PTR(texture, setSrgb(sRgb == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfTexture_isSrgb(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL_PTR_RETURN(texture, isSrgb(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_setRepeated(sfTexture* texture, sfBool repeated)
|
||||
{
|
||||
@@ -242,6 +256,20 @@ sfBool sfTexture_isRepeated(const sfTexture* texture)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfTexture_generateMipmap(sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL_PTR_RETURN(texture, generateMipmap(), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfTexture_getNativeHandle(const sfTexture* texture)
|
||||
{
|
||||
CSFML_CALL_PTR_RETURN(texture, getNativeHandle(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfTexture_bind(const sfTexture* texture)
|
||||
{
|
||||
|
||||
@@ -54,14 +54,14 @@ void sfVertexArray_destroy(sfVertexArray* vertexArray)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray)
|
||||
size_t sfVertexArray_getVertexCount(const sfVertexArray* vertexArray)
|
||||
{
|
||||
CSFML_CALL_RETURN(vertexArray, getVertexCount(), 0);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index)
|
||||
sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, size_t index)
|
||||
{
|
||||
CSFML_CHECK_RETURN(vertexArray, NULL);
|
||||
|
||||
@@ -78,7 +78,7 @@ void sfVertexArray_clear(sfVertexArray* vertexArray)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount)
|
||||
void sfVertexArray_resize(sfVertexArray* vertexArray, size_t vertexCount)
|
||||
{
|
||||
CSFML_CALL(vertexArray, resize(vertexCount));
|
||||
}
|
||||
|
||||
@@ -189,11 +189,11 @@ sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password)
|
||||
sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* name, const char* password)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.login(userName ? userName : "", password ? password : ""));
|
||||
return new sfFtpResponse(ftp->This.login(name ? name : "", password ? password : ""));
|
||||
}
|
||||
|
||||
|
||||
@@ -288,22 +288,31 @@ sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode)
|
||||
sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* localPath, sfFtpTransferMode mode)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.download(distantFile ? distantFile : "",
|
||||
destPath ? destPath : "",
|
||||
return new sfFtpResponse(ftp->This.download(remoteFile ? remoteFile : "",
|
||||
localPath ? localPath : "",
|
||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode)
|
||||
sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.upload(localFile ? localFile : "",
|
||||
destPath ? destPath : "",
|
||||
remotePath ? remotePath : "",
|
||||
static_cast<sf::Ftp::TransferMode>(mode)));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfFtpResponse* sfFtp_sendCommand(sfFtp* ftp, const char* command, const char* parameter)
|
||||
{
|
||||
CSFML_CHECK_RETURN(ftp, NULL);
|
||||
|
||||
return new sfFtpResponse(ftp->This.sendCommand(command ? command : "", parameter ? parameter : ""));
|
||||
}
|
||||
@@ -53,6 +53,10 @@ namespace
|
||||
const sfIpAddress sfIpAddress_None = sfIpAddress_fromBytes(0, 0, 0, 0);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfIpAddress sfIpAddress_Any = sfIpAddress_fromBytes(0, 0, 0, 0);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfIpAddress sfIpAddress_LocalHost = sfIpAddress_fromBytes(127, 0, 0, 1);
|
||||
|
||||
|
||||
@@ -67,11 +67,12 @@ unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port)
|
||||
sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port, sfIpAddress address)
|
||||
{
|
||||
CSFML_CHECK_RETURN(listener, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(listener->This.listen(port));
|
||||
sf::IpAddress sfmlAddress(address.address);
|
||||
return static_cast<sfSocketStatus>(listener->This.listen(port, sfmlAddress));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,13 +89,13 @@ unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout)
|
||||
sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout)
|
||||
{
|
||||
sf::IpAddress address(host.address);
|
||||
sf::IpAddress address(remoteAddress.address);
|
||||
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.connect(address, port, sf::microseconds(timeout.microseconds)));
|
||||
return static_cast<sfSocketStatus>(socket->This.connect(address, remotePort, sf::microseconds(timeout.microseconds)));
|
||||
}
|
||||
|
||||
|
||||
@@ -116,18 +116,27 @@ sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t si
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived)
|
||||
sfSocketStatus sfTcpSocket_sendPartial(sfTcpSocket* socket, const void* data, size_t size, size_t* sent)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
if (sizeReceived)
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size, *sent));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t size, size_t* received)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
if (received)
|
||||
{
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, maxSize, *sizeReceived));
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, size, *received));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::size_t size = 0;
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, maxSize, size));
|
||||
std::size_t tempReceived = 0;
|
||||
return static_cast<sfSocketStatus>(socket->This.receive(data, size, tempReceived));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,11 +68,12 @@ unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port, sfIpAddress address)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.bind(port));
|
||||
sf::IpAddress sfmlAddress(address.address);
|
||||
return static_cast<sfSocketStatus>(socket->This.bind(port, sfmlAddress));
|
||||
}
|
||||
|
||||
|
||||
@@ -84,74 +85,74 @@ void sfUdpSocket_unbind(sfUdpSocket* socket)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
// Convert the address
|
||||
sf::IpAddress receiver(address.address);
|
||||
sf::IpAddress address(remoteAddress.address);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size, receiver, port));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(data, size, address, remotePort));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port)
|
||||
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
// Call SFML internal function
|
||||
sf::IpAddress sender;
|
||||
unsigned short senderPort;
|
||||
std::size_t received;
|
||||
sf::IpAddress address;
|
||||
unsigned short port;
|
||||
std::size_t sizeReceived;
|
||||
|
||||
sf::Socket::Status status = socket->This.receive(data, maxSize, received, sender, senderPort);
|
||||
sf::Socket::Status status = socket->This.receive(data, size, sizeReceived, address, port);
|
||||
if (status != sf::Socket::Done)
|
||||
return static_cast<sfSocketStatus>(status);
|
||||
|
||||
if (sizeReceived)
|
||||
*sizeReceived = received;
|
||||
if (received)
|
||||
*received = sizeReceived;
|
||||
|
||||
if (address)
|
||||
strncpy(address->address, sender.toString().c_str(), 16);
|
||||
if (remoteAddress)
|
||||
strncpy(remoteAddress->address, address.toString().c_str(), 16);
|
||||
|
||||
if (port)
|
||||
*port = senderPort;
|
||||
if (remotePort)
|
||||
*remotePort = port;
|
||||
|
||||
return sfSocketDone;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
// Convert the address
|
||||
sf::IpAddress receiver(address.address);
|
||||
sf::IpAddress address(remoteAddress.address);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.send(packet->This, receiver, port));
|
||||
return static_cast<sfSocketStatus>(socket->This.send(packet->This, address, remotePort));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port)
|
||||
sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
CSFML_CHECK_RETURN(packet, sfSocketError);
|
||||
|
||||
sf::IpAddress sender;
|
||||
unsigned short senderPort;
|
||||
sf::Socket::Status status = socket->This.receive(packet->This, sender, senderPort);
|
||||
sf::IpAddress address;
|
||||
unsigned short port;
|
||||
|
||||
sf::Socket::Status status = socket->This.receive(packet->This, address, port);
|
||||
if (status != sf::Socket::Done)
|
||||
return static_cast<sfSocketStatus>(status);
|
||||
|
||||
if (address)
|
||||
strncpy(address->address, sender.toString().c_str(), 16);
|
||||
if (remoteAddress)
|
||||
strncpy(remoteAddress->address, address.toString().c_str(), 16);
|
||||
|
||||
if (port)
|
||||
*port = senderPort;
|
||||
if (remotePort)
|
||||
*remotePort = port;
|
||||
|
||||
return sfSocketDone;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ set(SRCROOT ${CMAKE_SOURCE_DIR}/src/SFML/Window)
|
||||
set(SRC
|
||||
${INCROOT}/Export.h
|
||||
${SRCROOT}/Context.cpp
|
||||
${SRCROOT}/ContextSettingsInternal.h
|
||||
${SRCROOT}/ContextStruct.h
|
||||
${INCROOT}/Context.h
|
||||
${INCROOT}/Event.h
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <SFML/Window/Context.h>
|
||||
#include <SFML/Window/ContextStruct.h>
|
||||
#include <SFML/Internal.h>
|
||||
#include <SFML/Window/ContextSettingsInternal.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -45,7 +46,19 @@ void sfContext_destroy(sfContext* context)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfContext_setActive(sfContext* context, sfBool active)
|
||||
sfBool sfContext_setActive(sfContext* context, sfBool active)
|
||||
{
|
||||
CSFML_CALL(context, setActive(active == sfTrue));
|
||||
CSFML_CALL_RETURN(context, setActive(active == sfTrue), false)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfContextSettings sfContext_getSettings(const sfContext* context)
|
||||
{
|
||||
sfContextSettings settings = priv::sfContextSettings_null();
|
||||
CSFML_CHECK_RETURN(context, settings);
|
||||
|
||||
const sf::ContextSettings& params = context->This.getSettings();
|
||||
priv::sfContextSettings_readFromCpp(params, settings);
|
||||
|
||||
return settings;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2016 Laurent Gomila (laurent@sfml-dev.org)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it freely,
|
||||
// subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented;
|
||||
// you must not claim that you wrote the original software.
|
||||
// If you use this software in a product, an acknowledgment
|
||||
// in the product documentation would be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such,
|
||||
// and must not be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef SFML_CONTEXTSETTINGSINTERNAL_H
|
||||
#define SFML_CONTEXTSETTINGSINTERNAL_H
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window.h>
|
||||
#include <SFML/Window.hpp>
|
||||
|
||||
namespace priv
|
||||
{
|
||||
////////////////////////////////////////////////////////////
|
||||
// Create a "null" sfContextSettings that's returned in case of an error.
|
||||
////////////////////////////////////////////////////////////
|
||||
inline sfContextSettings sfContextSettings_null()
|
||||
{
|
||||
sfContextSettings settings = {0, 0, 0, 0, 0, 0, sfFalse};
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Read the data of an sf::ContextSettings into an sfContextSettings
|
||||
////////////////////////////////////////////////////////////
|
||||
inline void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSettings& to)
|
||||
{
|
||||
to.depthBits = from.depthBits;
|
||||
to.stencilBits = from.stencilBits;
|
||||
to.antialiasingLevel = from.antialiasingLevel;
|
||||
to.majorVersion = from.majorVersion;
|
||||
to.minorVersion = from.minorVersion;
|
||||
to.attributeFlags = from.attributeFlags;
|
||||
to.sRgbCapable = from.sRgbCapable ? sfTrue : sfFalse;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Write the data of an sfContextSettings into an sf::ContextSettings
|
||||
////////////////////////////////////////////////////////////
|
||||
inline void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSettings& to)
|
||||
{
|
||||
to.depthBits = from.depthBits;
|
||||
to.stencilBits = from.stencilBits;
|
||||
to.antialiasingLevel = from.antialiasingLevel;
|
||||
to.majorVersion = from.majorVersion;
|
||||
to.minorVersion = from.minorVersion;
|
||||
to.attributeFlags = from.attributeFlags;
|
||||
to.sRgbCapable = from.sRgbCapable == sfTrue;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SFML_CONTEXTSETTINGSINTERNAL_H
|
||||
@@ -35,3 +35,9 @@ sfBool sfKeyboard_isKeyPressed(sfKeyCode key)
|
||||
{
|
||||
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Key>(key));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfKeyboard_setVirtualKeyboardVisible(sfBool visible)
|
||||
{
|
||||
sf::Keyboard::setVirtualKeyboardVisible(visible == sfTrue);
|
||||
}
|
||||
+14
-22
@@ -28,6 +28,7 @@
|
||||
#include <SFML/Window/Window.h>
|
||||
#include <SFML/Window/WindowStruct.h>
|
||||
#include <SFML/Internal.h>
|
||||
#include <SFML/Window/ContextSettingsInternal.h>
|
||||
#include <SFML/ConvertEvent.h>
|
||||
|
||||
|
||||
@@ -41,11 +42,7 @@ sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, c
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
priv::sfContextSettings_writeToCpp(*settings, params);
|
||||
}
|
||||
|
||||
// Create the window
|
||||
@@ -65,11 +62,7 @@ sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
priv::sfContextSettings_writeToCpp(*settings, params);
|
||||
}
|
||||
|
||||
// Create the window
|
||||
@@ -87,11 +80,7 @@ sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettin
|
||||
sf::ContextSettings params;
|
||||
if (settings)
|
||||
{
|
||||
params.depthBits = settings->depthBits;
|
||||
params.stencilBits = settings->stencilBits;
|
||||
params.antialiasingLevel = settings->antialiasingLevel;
|
||||
params.majorVersion = settings->majorVersion;
|
||||
params.minorVersion = settings->minorVersion;
|
||||
priv::sfContextSettings_writeToCpp(*settings, params);
|
||||
}
|
||||
|
||||
// Create the window
|
||||
@@ -125,15 +114,11 @@ sfBool sfWindow_isOpen(const sfWindow* window)
|
||||
////////////////////////////////////////////////////////////
|
||||
sfContextSettings sfWindow_getSettings(const sfWindow* window)
|
||||
{
|
||||
sfContextSettings settings = {0, 0, 0, 0, 0};
|
||||
sfContextSettings settings = priv::sfContextSettings_null();
|
||||
CSFML_CHECK_RETURN(window, settings);
|
||||
|
||||
const sf::ContextSettings& params = window->This.getSettings();
|
||||
settings.depthBits = params.depthBits;
|
||||
settings.stencilBits = params.stencilBits;
|
||||
settings.antialiasingLevel = params.antialiasingLevel;
|
||||
settings.majorVersion = params.majorVersion;
|
||||
settings.minorVersion = params.minorVersion;
|
||||
priv::sfContextSettings_readFromCpp(params, settings);
|
||||
|
||||
return settings;
|
||||
}
|
||||
@@ -258,6 +243,13 @@ void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed)
|
||||
{
|
||||
CSFML_CALL(window, setMouseCursorGrabbed(grabbed == sfTrue));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled)
|
||||
{
|
||||
@@ -317,7 +309,7 @@ void sfWindow_setJoystickThreshold(sfWindow* window, float threshold)
|
||||
////////////////////////////////////////////////////////////
|
||||
sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window)
|
||||
{
|
||||
CSFML_CHECK_RETURN(window, NULL);
|
||||
CSFML_CHECK_RETURN(window, 0);
|
||||
|
||||
return (sfWindowHandle)window->This.getSystemHandle();
|
||||
}
|
||||
Reference in new issue
Block a user