diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cdff25..b10b974 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake) # setup version numbers set(VERSION_MAJOR 2) -set(VERSION_MINOR 4) +set(VERSION_MINOR 5) set(VERSION_PATCH 0) # add the CSFML header path @@ -42,7 +42,7 @@ set(CMAKE_SKIP_BUILD_RPATH TRUE) # define an option for choosing between static and dynamic C runtime (Windows only) if(SFML_OS_WINDOWS) set(STATIC_STD_LIBS FALSE CACHE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs") - + # for VC++, we can apply it globally by modifying the compiler flags if(SFML_COMPILER_MSVC AND STATIC_STD_LIBS) foreach(flag diff --git a/include/SFML/Audio.h b/include/SFML/Audio.h index 4959f8e..05396a2 100644 --- a/include/SFML/Audio.h +++ b/include/SFML/Audio.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/Export.h b/include/SFML/Audio/Export.h index 8e728fc..4562cec 100644 --- a/include/SFML/Audio/Export.h +++ b/include/SFML/Audio/Export.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/Listener.h b/include/SFML/Audio/Listener.h index 192b093..9969c1e 100644 --- a/include/SFML/Audio/Listener.h +++ b/include/SFML/Audio/Listener.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/Music.h b/include/SFML/Audio/Music.h index 706ad36..f41e10e 100644 --- a/include/SFML/Audio/Music.h +++ b/include/SFML/Audio/Music.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -37,6 +37,17 @@ #include +//////////////////////////////////////////////////////////// +/// \brief Structure defining a time range +/// +//////////////////////////////////////////////////////////// +typedef struct +{ + sfTime offset; ///< The beginning offset of the time range + sfTime length; ///< The length of the time range +} sfTimeSpan; + + //////////////////////////////////////////////////////////// /// \brief Create a new music and load it from a file /// @@ -128,6 +139,45 @@ CSFML_AUDIO_API sfBool sfMusic_getLoop(const sfMusic* music); //////////////////////////////////////////////////////////// CSFML_AUDIO_API sfTime sfMusic_getDuration(const sfMusic* music); +//////////////////////////////////////////////////////////// +/// \brief Get the positions of the of the sound's looping sequence +/// +/// \return Loop Time position class. +/// +/// \warning Since sfMusic_setLoopPoints() performs some adjustments on the +/// provided values and rounds them to internal samples, a call to +/// sfMusic_getLoopPoints() is not guaranteed to return the same times passed +/// into a previous call to sfMusic_setLoopPoints(). However, it is guaranteed +/// to return times that will map to the valid internal samples of +/// this Music if they are later passed to sfMusic_setLoopPoints(). +/// +/// \see setLoopPoints +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API sfTimeSpan sfMusic_getLoopPoints(const sfMusic* music); + +//////////////////////////////////////////////////////////// +/// \brief Sets the beginning and end of the sound's looping sequence using sf::Time +/// +/// Loop points allow one to specify a pair of positions such that, when the music +/// is enabled for looping, it will seamlessly seek to the beginning whenever it +/// encounters the end. Valid ranges for timePoints.offset and timePoints.length are +/// [0, Dur) and (0, Dur-offset] respectively, where Dur is the value returned by sfMusic_getDuration(). +/// Note that the EOF "loop point" from the end to the beginning of the stream is still honored, +/// in case the caller seeks to a point after the end of the loop range. This function can be +/// safely called at any point after a stream is opened, and will be applied to a playing sound +/// without affecting the current playing offset. +/// +/// \warning Setting the loop points while the stream's status is Paused +/// will set its status to Stopped. The playing offset will be unaffected. +/// +/// \param timePoints The definition of the loop. Can be any time points within the sound's length +/// +/// \see getLoopPoints +/// +//////////////////////////////////////////////////////////// +CSFML_AUDIO_API void sfMusic_setLoopPoints(sfMusic* music, sfTimeSpan timePoints); + //////////////////////////////////////////////////////////// /// \brief Start or resume playing a music /// diff --git a/include/SFML/Audio/Sound.h b/include/SFML/Audio/Sound.h index f99982c..958a4e5 100644 --- a/include/SFML/Audio/Sound.h +++ b/include/SFML/Audio/Sound.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/SoundBuffer.h b/include/SFML/Audio/SoundBuffer.h index ad29dbc..ad454f0 100644 --- a/include/SFML/Audio/SoundBuffer.h +++ b/include/SFML/Audio/SoundBuffer.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/SoundBufferRecorder.h b/include/SFML/Audio/SoundBufferRecorder.h index 41674f5..af51d5b 100644 --- a/include/SFML/Audio/SoundBufferRecorder.h +++ b/include/SFML/Audio/SoundBufferRecorder.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/SoundRecorder.h b/include/SFML/Audio/SoundRecorder.h index 610d8de..9038dc3 100644 --- a/include/SFML/Audio/SoundRecorder.h +++ b/include/SFML/Audio/SoundRecorder.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/SoundStatus.h b/include/SFML/Audio/SoundStatus.h index 9eeb00b..169cc7f 100644 --- a/include/SFML/Audio/SoundStatus.h +++ b/include/SFML/Audio/SoundStatus.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/SoundStream.h b/include/SFML/Audio/SoundStream.h index a8389be..dece3f3 100644 --- a/include/SFML/Audio/SoundStream.h +++ b/include/SFML/Audio/SoundStream.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Audio/Types.h b/include/SFML/Audio/Types.h index 7accaa6..b8e4075 100644 --- a/include/SFML/Audio/Types.h +++ b/include/SFML/Audio/Types.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Config.h b/include/SFML/Config.h index 421cd61..cb2b0fb 100644 --- a/include/SFML/Config.h +++ b/include/SFML/Config.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -30,7 +30,7 @@ // Define the CSFML version //////////////////////////////////////////////////////////// #define CSFML_VERSION_MAJOR 2 -#define CSFML_VERSION_MINOR 4 +#define CSFML_VERSION_MINOR 5 #define CSFML_VERSION_PATCH 0 diff --git a/include/SFML/GPUPreference.h b/include/SFML/GPUPreference.h new file mode 100644 index 0000000..2045e89 --- /dev/null +++ b/include/SFML/GPUPreference.h @@ -0,0 +1,74 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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_GPUPREFERENCE_H +#define SFML_GPUPREFERENCE_H + + +//////////////////////////////////////////////////////////// +/// Headers +//////////////////////////////////////////////////////////// +#include + + +//////////////////////////////////////////////////////////// +/// \file +/// +/// \brief File containing SFML_DEFINE_DISCRETE_GPU_PREFERENCE +/// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +/// \def SFML_DEFINE_DISCRETE_GPU_PREFERENCE +/// +/// \brief A macro to encourage usage of the discrete GPU +/// +/// In order to inform the Nvidia/AMD driver that an SFML +/// application could benefit from using the more powerful +/// discrete GPU, special symbols have to be publicly +/// exported from the final executable. +/// +/// SFML defines a helper macro to easily do this. +/// +/// Place SFML_DEFINE_DISCRETE_GPU_PREFERENCE in the +/// global scope of a source file that will be linked into +/// the final executable. Typically it is best to place it +/// where the main function is also defined. +/// +//////////////////////////////////////////////////////////// +#if defined(SFML_SYSTEM_WINDOWS) + + #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \ + CSFML_EXTERN_C __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \ + CSFML_EXTERN_C __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1; + +#else + + #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE + +#endif + + +#endif // SFML_GPUPREFERENCE_H diff --git a/include/SFML/Graphics.h b/include/SFML/Graphics.h index 87be02a..b21c453 100644 --- a/include/SFML/Graphics.h +++ b/include/SFML/Graphics.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -53,6 +53,7 @@ #include #include #include +#include #include diff --git a/include/SFML/Graphics/BlendMode.h b/include/SFML/Graphics/BlendMode.h index 8d3c144..48ea21b 100644 --- a/include/SFML/Graphics/BlendMode.h +++ b/include/SFML/Graphics/BlendMode.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -35,7 +35,7 @@ /// \brief Enumeration of the blending factors /// //////////////////////////////////////////////////////////// -typedef enum +typedef enum { sfBlendFactorZero, ///< (0, 0, 0, 0) sfBlendFactorOne, ///< (1, 1, 1, 1) diff --git a/include/SFML/Graphics/CircleShape.h b/include/SFML/Graphics/CircleShape.h index ae3038e..b3884cd 100644 --- a/include/SFML/Graphics/CircleShape.h +++ b/include/SFML/Graphics/CircleShape.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Color.h b/include/SFML/Graphics/Color.h index b14b537..bd355c1 100644 --- a/include/SFML/Graphics/Color.h +++ b/include/SFML/Graphics/Color.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/ConvexShape.h b/include/SFML/Graphics/ConvexShape.h index 4b62fa5..ab1d2d3 100644 --- a/include/SFML/Graphics/ConvexShape.h +++ b/include/SFML/Graphics/ConvexShape.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Export.h b/include/SFML/Graphics/Export.h index 6db1a98..750b0d1 100644 --- a/include/SFML/Graphics/Export.h +++ b/include/SFML/Graphics/Export.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Font.h b/include/SFML/Graphics/Font.h index cf5cb5a..aca6735 100644 --- a/include/SFML/Graphics/Font.h +++ b/include/SFML/Graphics/Font.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/FontInfo.h b/include/SFML/Graphics/FontInfo.h index 69ca084..cbe4488 100644 --- a/include/SFML/Graphics/FontInfo.h +++ b/include/SFML/Graphics/FontInfo.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Glsl.h b/include/SFML/Graphics/Glsl.h index 16cb142..ab137ef 100644 --- a/include/SFML/Graphics/Glsl.h +++ b/include/SFML/Graphics/Glsl.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Glyph.h b/include/SFML/Graphics/Glyph.h index 46a5c46..c2e9827 100644 --- a/include/SFML/Graphics/Glyph.h +++ b/include/SFML/Graphics/Glyph.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Image.h b/include/SFML/Graphics/Image.h index 2dcb684..e4572f8 100644 --- a/include/SFML/Graphics/Image.h +++ b/include/SFML/Graphics/Image.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/PrimitiveType.h b/include/SFML/Graphics/PrimitiveType.h index 642335d..e073539 100644 --- a/include/SFML/Graphics/PrimitiveType.h +++ b/include/SFML/Graphics/PrimitiveType.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -39,7 +39,7 @@ /// and view. /// //////////////////////////////////////////////////////////// -typedef enum +typedef enum { sfPoints, ///< List of individual points sfLines, ///< List of individual lines diff --git a/include/SFML/Graphics/Rect.h b/include/SFML/Graphics/Rect.h index 2f52293..302b2e4 100644 --- a/include/SFML/Graphics/Rect.h +++ b/include/SFML/Graphics/Rect.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/RectangleShape.h b/include/SFML/Graphics/RectangleShape.h index 6fb0b58..734d48c 100644 --- a/include/SFML/Graphics/RectangleShape.h +++ b/include/SFML/Graphics/RectangleShape.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/RenderStates.h b/include/SFML/Graphics/RenderStates.h index 806ec39..ce19c8c 100644 --- a/include/SFML/Graphics/RenderStates.h +++ b/include/SFML/Graphics/RenderStates.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/RenderTexture.h b/include/SFML/Graphics/RenderTexture.h index 5bc3fed..ee405f8 100644 --- a/include/SFML/Graphics/RenderTexture.h +++ b/include/SFML/Graphics/RenderTexture.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -48,9 +49,24 @@ /// /// \return A new sfRenderTexture object, or NULL if it failed /// +/// \deprecated +/// Use sfRenderTexture_createWithSettings instead. +/// //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer); +//////////////////////////////////////////////////////////// +/// \brief Construct a new render texture +/// +/// \param width Width of the render texture +/// \param height Height of the render texture +/// \param settings Settings of the render texture +/// +/// \return A new sfRenderTexture object, or NULL if it failed +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_createWithSettings(unsigned int width, unsigned int height, sfContextSettings settings); + //////////////////////////////////////////////////////////// /// \brief Destroy an existing render texture /// @@ -205,6 +221,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderT CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states); CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states); CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, const sfVertexBuffer* object, const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by an array of vertices to a render texture @@ -278,6 +295,15 @@ CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTex //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture); + +//////////////////////////////////////////////////////////// +/// \brief Get the maximum anti-aliasing level supported by the system +/// +/// \return The maximum anti-aliasing level supported by the system +/// +//////////////////////////////////////////////////////////// +unsigned int sfRenderTexture_getMaximumAntialiasingLevel(); + //////////////////////////////////////////////////////////// /// \brief Enable or disable the smooth filter on a render texture /// diff --git a/include/SFML/Graphics/RenderWindow.h b/include/SFML/Graphics/RenderWindow.h index e55a549..34de939 100644 --- a/include/SFML/Graphics/RenderWindow.h +++ b/include/SFML/Graphics/RenderWindow.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -241,6 +241,25 @@ CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* ren //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed); +//////////////////////////////////////////////////////////// +/// \brief Set the displayed cursor to a native system cursor +/// +/// Upon window creation, the arrow cursor is used by default. +/// +/// \warning The cursor must not be destroyed while in use by +/// the window. +/// +/// \warning Features related to Cursor are not supported on +/// iOS and Android. +/// +/// \param cursor Native system cursor type to display +/// +/// \see sfCursor_createFromSystem +/// \see sfCursor_createFromPixels +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursor(sfRenderWindow* window, const sfCursor* cursor); + //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat for keydown events /// @@ -445,6 +464,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWin CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states); CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states); CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVertexBuffer* object, const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by an array of vertices to a render window diff --git a/include/SFML/Graphics/Shader.h b/include/SFML/Graphics/Shader.h index 003b44e..8f2b569 100644 --- a/include/SFML/Graphics/Shader.h +++ b/include/SFML/Graphics/Shader.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Shape.h b/include/SFML/Graphics/Shape.h index b8cdc25..85a8e00 100644 --- a/include/SFML/Graphics/Shape.h +++ b/include/SFML/Graphics/Shape.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Sprite.h b/include/SFML/Graphics/Sprite.h index 2b040e1..758eff0 100644 --- a/include/SFML/Graphics/Sprite.h +++ b/include/SFML/Graphics/Sprite.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Text.h b/include/SFML/Graphics/Text.h index 0eaa6d3..20ae4bd 100644 --- a/include/SFML/Graphics/Text.h +++ b/include/SFML/Graphics/Text.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -276,6 +276,41 @@ CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font); //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size); + //////////////////////////////////////////////////////////// +/// \brief Set the line spacing factor +/// +/// The default spacing between lines is defined by the font. +/// This method enables you to set a factor for the spacing +/// between lines. By default the line spacing factor is 1. +/// +/// \param text Text object +/// \param spacingFactor New line spacing factor +/// +/// \see sfText_getLineSpacing +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setLineSpacing(sfText* text, float spacingFactor); + +//////////////////////////////////////////////////////////// +/// \brief Set the letter spacing factor +/// +/// The default spacing between letters is defined by the font. +/// This factor doesn't directly apply to the existing +/// spacing between each character, it rather adds a fixed +/// space between them which is calculated from the font +/// metrics and the character size. +/// Note that factors below 1 (including negative numbers) bring +/// characters closer to each other. +/// By default the letter spacing factor is 1. +/// +/// \param text Text object +/// \param spacingFactor New letter spacing factor +/// +/// \see sfText_getLetterSpacing +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfText_setLetterSpacing(sfText* text, float spacingFactor); + //////////////////////////////////////////////////////////// /// \brief Set the style of a text /// @@ -388,6 +423,30 @@ CSFML_GRAPHICS_API const sfFont* sfText_getFont(const sfText* text); //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text); +//////////////////////////////////////////////////////////// +/// \brief Get the size of the letter spacing factor +/// +/// \param text Text object +/// +/// \return Size of the letter spacing factor +/// +/// \see sfText_setLetterSpacing +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float sfText_getLetterSpacing(const sfText* text); + +//////////////////////////////////////////////////////////// +/// \brief Get the size of the line spacing factor +/// +/// \param text Text object +/// +/// \return Size of the line spacing factor +/// +/// \see sfText_setLineSpacing +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API float getLineSpacing(const sfText* text); + //////////////////////////////////////////////////////////// /// \brief Get the style of a text /// diff --git a/include/SFML/Graphics/Texture.h b/include/SFML/Graphics/Texture.h index 3c83527..a0eccea 100644 --- a/include/SFML/Graphics/Texture.h +++ b/include/SFML/Graphics/Texture.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -144,6 +144,24 @@ CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture); //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y); +//////////////////////////////////////////////////////////// +/// \brief Update a part of this texture from another texture +/// +/// No additional check is performed on the size of the texture, +/// passing an invalid combination of texture size and offset +/// will lead to an undefined behavior. +/// +/// This function does nothing if either texture was not +/// previously created. +/// +/// \param destination Destination texture to copy source texture to +/// \param source Source texture to copy to destination texture +/// \param x X offset in this texture where to copy the source texture +/// \param y Y offset in this texture where to copy the source texture +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTexture_updateFromTexture(sfTexture* destination, const sfTexture* source, unsigned int x, unsigned int y); + //////////////////////////////////////////////////////////// /// \brief Update a texture from an image /// @@ -289,6 +307,15 @@ CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture); //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture* texture); +//////////////////////////////////////////////////////////// +/// \brief Swap the contents of a texture with those of another +/// +/// \param left Instance to swap from +/// \param right Instance to swap with +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfTexture_swap(sfTexture* left, sfTexture* right); + //////////////////////////////////////////////////////////// /// \brief Get the underlying OpenGL handle of the texture. /// diff --git a/include/SFML/Graphics/Transform.h b/include/SFML/Graphics/Transform.h index 74f9a18..72b31cb 100644 --- a/include/SFML/Graphics/Transform.h +++ b/include/SFML/Graphics/Transform.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -206,5 +206,18 @@ CSFML_GRAPHICS_API void sfTransform_scale(sfTransform* transform, float scaleX, //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY); +//////////////////////////////////////////////////////////// +/// \brief Compare two transforms for equality +/// +/// Performs an element-wise comparison of the elements of the +/// left transform with the elements of the right transform. +/// +/// \param left Left operand (the first transform) +/// \param right Right operand (the second transform) +/// +/// \return true if the transforms are equal, false otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfTransform_equal(sfTransform* left, sfTransform* right); #endif // SFML_TRANSFORM_H diff --git a/include/SFML/Graphics/Transformable.h b/include/SFML/Graphics/Transformable.h index c63be72..6ef362f 100644 --- a/include/SFML/Graphics/Transformable.h +++ b/include/SFML/Graphics/Transformable.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/Types.h b/include/SFML/Graphics/Types.h index b6f8e93..8b8bf74 100644 --- a/include/SFML/Graphics/Types.h +++ b/include/SFML/Graphics/Types.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -40,6 +40,7 @@ typedef struct sfText sfText; typedef struct sfTexture sfTexture; typedef struct sfTransformable sfTransformable; typedef struct sfVertexArray sfVertexArray; +typedef struct sfVertexBuffer sfVertexBuffer; typedef struct sfView sfView; diff --git a/include/SFML/Graphics/Vertex.h b/include/SFML/Graphics/Vertex.h index a26dfcb..3436bb1 100644 --- a/include/SFML/Graphics/Vertex.h +++ b/include/SFML/Graphics/Vertex.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/VertexArray.h b/include/SFML/Graphics/VertexArray.h index 7262b35..e2be825 100644 --- a/include/SFML/Graphics/VertexArray.h +++ b/include/SFML/Graphics/VertexArray.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Graphics/VertexBuffer.h b/include/SFML/Graphics/VertexBuffer.h new file mode 100644 index 0000000..ab67d0c --- /dev/null +++ b/include/SFML/Graphics/VertexBuffer.h @@ -0,0 +1,254 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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_VERTEXBUFFER_H +#define SFML_VERTEXBUFFER_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include + + +//////////////////////////////////////////////////////////// +/// \brief Usage specifiers +/// +/// If data is going to be updated once or more every frame, +/// set the usage to sfVertexBufferStream. If data is going +/// to be set once and used for a long time without being +/// modified, set the usage to sfVertexBufferUsageStatic. +/// For everything else sfVertexBufferUsageDynamic should +/// be a good compromise. +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfVertexBufferStream, ///< Constantly changing data + sfVertexBufferDynamic, ///< Occasionally changing data + sfVertexBufferStatic ///< Rarely changing data +} sfVertexBufferUsage; + +//////////////////////////////////////////////////////////// +/// \brief Create a new vertex buffer with a specific +/// sfPrimitiveType and usage specifier. +/// +/// Creates the vertex buffer, allocating enough graphcis +/// memory to hold \p vertexCount vertices, and sets its +/// primitive type to \p type and usage to \p usage. +/// +/// \param vertexCount Amount of vertices +/// \param type Type of primitive +/// \param usage Usage specifier +/// +/// \return A new sfVertexBuffer object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_create(unsigned int vertexCount, sfPrimitiveType type, sfVertexBufferUsage usage); + +//////////////////////////////////////////////////////////// +/// \brief Copy an existing vertex buffer +/// +/// \param vertexBuffer Vertex buffer to copy +/// +/// \return Copied object +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_copy(const sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Destroy an existing vertex buffer +/// +/// \param vertexBuffer Vertex buffer to delete +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexBuffer_destroy(sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Return the vertex count +/// +/// \param vertexBuffer Vertex buffer object +/// +/// \return Number of vertices in the vertex buffer +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Update a part of the buffer from an array of vertices +/// +/// \p offset is specified as the number of vertices to skip +/// from the beginning of the buffer. +/// +/// If \p offset is 0 and \p vertexCount is equal to the size of +/// the currently created buffer, its whole contents are replaced. +/// +/// If \p offset is 0 and \p vertexCount is greater than the +/// size of the currently created buffer, a new buffer is created +/// containing the vertex data. +/// +/// If \p offset is 0 and \p vertexCount is less than the size of +/// the currently created buffer, only the corresponding region +/// is updated. +/// +/// If \p offset is not 0 and \p offset + \p vertexCount is greater +/// than the size of the currently created buffer, the update fails. +/// +/// No additional check is performed on the size of the vertex +/// array, passing invalid arguments will lead to undefined +/// behavior. +/// +/// \param vertices Array of vertices to copy to the buffer +/// \param vertexCount Number of vertices to copy +/// \param offset Offset in the buffer to copy to +/// +/// \return sfTrue if the update was successful +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset); + +//////////////////////////////////////////////////////////// +/// \brief Copy the contents of another buffer into this buffer +/// +/// \param vertexBuffer Vertex buffer object +/// \param other Vertex buffer whose contents to copy into first vertex buffer +/// +/// \return sfTrue if the copy was successful +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other); + +//////////////////////////////////////////////////////////// +/// \brief Swap the contents of this vertex buffer with those of another +/// +/// \param left Instance to swap +/// \param right Instance to swap with +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexBuffer_swap(sfVertexBuffer* left, sfVertexBuffer* right); + +//////////////////////////////////////////////////////////// +/// \brief Get the underlying OpenGL handle of the vertex buffer. +/// +/// 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. +/// +/// \return OpenGL handle of the vertex buffer or 0 if not yet created +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Set the type of primitives to draw +/// +/// This function defines how the vertices must be interpreted +/// when it's time to draw them. +/// +/// The default primitive type is sf::Points. +/// +/// \param vertexBuffer Vertex buffer object +/// \param type Type of primitive +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexBuffer_setPrimitiveType(sfVertexBuffer* vertexBuffer, sfPrimitiveType type); + +//////////////////////////////////////////////////////////// +/// \brief Get the type of primitives drawn by the vertex buffer +/// +/// \param vertexBuffer Vertex buffer object +/// +/// \return Primitive type +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfPrimitiveType sfVertexBuffer_getPrimitiveType(const sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Set the usage specifier of this vertex buffer +/// +/// This function provides a hint about how this vertex buffer is +/// going to be used in terms of data update frequency. +/// +/// After changing the usage specifier, the vertex buffer has +/// to be updated with new data for the usage specifier to +/// take effect. +/// +/// The default primitive type is sfVertexBufferStream. +/// +/// \param vertexBuffer Vertex buffer object +/// \param usage Usage specifier +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexBuffer_setUsage(sfVertexBuffer* vertexBuffer, sfVertexBufferUsage usage); + +//////////////////////////////////////////////////////////// +/// \brief Get the usage specifier of this vertex buffer +/// +/// \param vertexBuffer Vertex buffer object +/// +/// \return Usage specifier +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfVertexBufferUsage sfVertexBuffer_getUsage(const sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Bind a vertex buffer for rendering +/// +/// This function is not part of the graphics API, it mustn't be +/// used when drawing SFML entities. It must be used only if you +/// mix sfVertexBuffer with OpenGL code. +/// +/// \code +/// sfVertexBuffer* vb1, vb2; +/// ... +/// sfVertexBuffer_bind(vb1); +/// // draw OpenGL stuff that use vb1... +/// sfVertexBuffer_bind(vb2); +/// // draw OpenGL stuff that use vb2... +/// sfVertexBuffer_bind(NULL); +/// // draw OpenGL stuff that use no vertex buffer... +/// \endcode +/// +/// \param vertexBuffer Pointer to the vertex buffer to bind, can be null to use no vertex buffer +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether or not the system supports vertex buffers +/// +/// This function should always be called before using +/// the vertex buffer features. If it returns false, then +/// any attempt to use sf::VertexBuffer will fail. +/// +/// \return True if vertex buffers are supported, false otherwise +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API sfBool sfVertexBuffer_isAvailable(); + + +#endif // SFML_VERTEXBUFFER_H diff --git a/include/SFML/Graphics/View.h b/include/SFML/Graphics/View.h index af2d521..69f8ec8 100644 --- a/include/SFML/Graphics/View.h +++ b/include/SFML/Graphics/View.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network.h b/include/SFML/Network.h index 60d826e..a033108 100644 --- a/include/SFML/Network.h +++ b/include/SFML/Network.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/Export.h b/include/SFML/Network/Export.h index 8f35a9e..a2c9faa 100644 --- a/include/SFML/Network/Export.h +++ b/include/SFML/Network/Export.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/Ftp.h b/include/SFML/Network/Ftp.h index f15b840..696a336 100644 --- a/include/SFML/Network/Ftp.h +++ b/include/SFML/Network/Ftp.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -500,11 +500,12 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFi /// \param localFile Path of the local file to upload /// \param remotePath Where to put to file on the server /// \param mode Transfer mode +/// \param append Pass sfTrue to append to or sfFalse to overwrite the remote file if it already exists /// /// \return Server response to the request /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode); +CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, sfBool append); //////////////////////////////////////////////////////////// /// \brief Send a command to the FTP server diff --git a/include/SFML/Network/Http.h b/include/SFML/Network/Http.h index 5f7fc75..9447695 100644 --- a/include/SFML/Network/Http.h +++ b/include/SFML/Network/Http.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -43,7 +43,7 @@ typedef enum sfHttpPost, ///< Request in post mode, usually to send data to a page sfHttpHead, ///< Request a page's header only sfHttpPut, ///< Request in put mode, useful for a REST API - sfHttpDelete ///< Request in delete mode, useful for a REST API + sfHttpDelete ///< Request in delete mode, useful for a REST API } sfHttpMethod; diff --git a/include/SFML/Network/IpAddress.h b/include/SFML/Network/IpAddress.h index 7ca444c..befb918 100644 --- a/include/SFML/Network/IpAddress.h +++ b/include/SFML/Network/IpAddress.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/Packet.h b/include/SFML/Network/Packet.h index f7020a6..e81ba18 100644 --- a/include/SFML/Network/Packet.h +++ b/include/SFML/Network/Packet.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/SocketSelector.h b/include/SFML/Network/SocketSelector.h index 1d0edd6..74cd224 100644 --- a/include/SFML/Network/SocketSelector.h +++ b/include/SFML/Network/SocketSelector.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/SocketStatus.h b/include/SFML/Network/SocketStatus.h index 49d4321..84bf243 100644 --- a/include/SFML/Network/SocketStatus.h +++ b/include/SFML/Network/SocketStatus.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/TcpListener.h b/include/SFML/Network/TcpListener.h index 9e65c58..2686834 100644 --- a/include/SFML/Network/TcpListener.h +++ b/include/SFML/Network/TcpListener.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/TcpSocket.h b/include/SFML/Network/TcpSocket.h index cd1b2cc..ae4e61b 100644 --- a/include/SFML/Network/TcpSocket.h +++ b/include/SFML/Network/TcpSocket.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/Types.h b/include/SFML/Network/Types.h index 808aa42..f207c16 100644 --- a/include/SFML/Network/Types.h +++ b/include/SFML/Network/Types.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Network/UdpSocket.h b/include/SFML/Network/UdpSocket.h index e0d9fba..2e973f8 100644 --- a/include/SFML/Network/UdpSocket.h +++ b/include/SFML/Network/UdpSocket.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/OpenGL.h b/include/SFML/OpenGL.h index 7713da7..0474fd8 100644 --- a/include/SFML/OpenGL.h +++ b/include/SFML/OpenGL.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System.h b/include/SFML/System.h index 0262d64..faecbbc 100644 --- a/include/SFML/System.h +++ b/include/SFML/System.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Clock.h b/include/SFML/System/Clock.h index 98963b4..8633fea 100644 --- a/include/SFML/System/Clock.h +++ b/include/SFML/System/Clock.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Export.h b/include/SFML/System/Export.h index 4b1ae15..12cf6d9 100644 --- a/include/SFML/System/Export.h +++ b/include/SFML/System/Export.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/InputStream.h b/include/SFML/System/InputStream.h index 972ada4..420b3bb 100644 --- a/include/SFML/System/InputStream.h +++ b/include/SFML/System/InputStream.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Mutex.h b/include/SFML/System/Mutex.h index 581c8a0..b32b478 100644 --- a/include/SFML/System/Mutex.h +++ b/include/SFML/System/Mutex.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Sleep.h b/include/SFML/System/Sleep.h index e53030b..7f41a9c 100644 --- a/include/SFML/System/Sleep.h +++ b/include/SFML/System/Sleep.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Thread.h b/include/SFML/System/Thread.h index 22c01d3..8a5286c 100644 --- a/include/SFML/System/Thread.h +++ b/include/SFML/System/Thread.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Time.h b/include/SFML/System/Time.h index 1388951..233eb58 100644 --- a/include/SFML/System/Time.h +++ b/include/SFML/System/Time.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -41,7 +41,7 @@ typedef struct } sfTime; //////////////////////////////////////////////////////////// -/// \brief Predefined "zero" time value +/// \brief Predefined "zero" time value /// //////////////////////////////////////////////////////////// CSFML_SYSTEM_API sfTime sfTime_Zero; diff --git a/include/SFML/System/Types.h b/include/SFML/System/Types.h index 2237594..b171683 100644 --- a/include/SFML/System/Types.h +++ b/include/SFML/System/Types.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Vector2.h b/include/SFML/System/Vector2.h index 3b14eab..b7564bc 100644 --- a/include/SFML/System/Vector2.h +++ b/include/SFML/System/Vector2.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/System/Vector3.h b/include/SFML/System/Vector3.h index 67f18d4..2f7377e 100644 --- a/include/SFML/System/Vector3.h +++ b/include/SFML/System/Vector3.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window.h b/include/SFML/Window.h index 742454b..3a06ae6 100644 --- a/include/SFML/Window.h +++ b/include/SFML/Window.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -30,7 +30,9 @@ //////////////////////////////////////////////////////////// #include +#include #include +#include #include #include #include diff --git a/include/SFML/Window/Clipboard.h b/include/SFML/Window/Clipboard.h new file mode 100644 index 0000000..5cc68f7 --- /dev/null +++ b/include/SFML/Window/Clipboard.h @@ -0,0 +1,85 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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_CLIPBOARD_H +#define SFML_CLIPBOARD_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + + +//////////////////////////////////////////////////////////// +/// \brief Get the content of the clipboard as string data (returns an ANSI string) +/// +/// This function returns the content of the clipboard +/// as a string. If the clipboard does not contain string +/// it returns an empty string. +/// +/// \return Clipboard contents as a locale-dependent ANSI string +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API const char* sfClipboard_getString(); + + +//////////////////////////////////////////////////////////// +/// \brief Get the content of the clipboard as string data (returns a Unicode string) +/// +/// This function returns the content of the clipboard +/// as a string. If the clipboard does not contain string +/// it returns an empty string. +/// +/// \return Clipboard contents as UTF-32 +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API const sfUint32* sfClipboard_getUnicodeString(); + +//////////////////////////////////////////////////////////// +/// \brief Set the content of the clipboard as ANSI string data +/// +/// This function sets the content of the clipboard as an +/// ANSI string. +/// +/// \param text ANSI string containing the data to be sent +/// to the clipboard +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfClipboard_setString(const char* text); + +//////////////////////////////////////////////////////////// +/// \brief Set the content of the clipboard as Unicode string data +/// +/// This function sets the content of the clipboard as a +/// Unicode string. +/// +/// \param text Unicode string containing the data to be sent +/// to the clipboard +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfClipboard_setUnicodeString(const sfUint32* text); + + +#endif // SFML_CURSOR_H diff --git a/include/SFML/Window/Context.h b/include/SFML/Window/Context.h index 9bb651f..d53a81d 100644 --- a/include/SFML/Window/Context.h +++ b/include/SFML/Window/Context.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -73,4 +73,15 @@ CSFML_WINDOW_API sfBool sfContext_setActive(sfContext* context, sfBool active); //////////////////////////////////////////////////////////// CSFML_WINDOW_API sfContextSettings sfContext_getSettings(const sfContext* context); +//////////////////////////////////////////////////////////// +/// \brief Get the currently active context's ID +/// +/// The context ID is used to identify contexts when +/// managing unshareable OpenGL resources. +/// +/// \return The active context's ID or 0 if no context is currently active +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfUint64 sfContext_getActiveContextId(); + #endif // SFML_CONTEXT_H diff --git a/include/SFML/Window/Cursor.h b/include/SFML/Window/Cursor.h new file mode 100644 index 0000000..76057b7 --- /dev/null +++ b/include/SFML/Window/Cursor.h @@ -0,0 +1,132 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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_CURSOR_H +#define SFML_CURSOR_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + + +//////////////////////////////////////////////////////////// +/// \brief Enumeration of the native system cursor types +/// +/// Refer to the following table to determine which cursor +/// is available on which platform. +/// +/// Type | Linux | Mac OS X | Windows +/// ------------------------------------|:-----:|:--------:|:--------: +/// sfCursorArrow | yes | yes | yes +/// sfCursorArrowWait | no | no | yes +/// sfCursorWait | yes | no | yes +/// sfCursorText | yes | yes | yes +/// sfCursorHand | yes | yes | yes +/// sfCursorSizeHorizontal | yes | yes | yes +/// sfCursorSizeVertical | yes | yes | yes +/// sfCursorSizeTopLeftBottomRight | no | no | yes +/// sfCursorSizeBottomLeftTopRight | no | no | yes +/// sfCursorSizeAll | yes | no | yes +/// sfCursorCross | yes | yes | yes +/// sfCursorHelp | yes | no | yes +/// sfCursorNotAllowed | yes | yes | yes +/// +//////////////////////////////////////////////////////////// +typedef enum +{ + sfCursorArrow, ///< Arrow cursor (default) + sfCursorArrowWait, ///< Busy arrow cursor + sfCursorWait, ///< Busy cursor + sfCursorText, ///< I-beam, cursor when hovering over a field allowing text entry + sfCursorHand, ///< Pointing hand cursor + sfCursorSizeHorizontal, ///< Horizontal double arrow cursor + sfCursorSizeVertical, ///< Vertical double arrow cursor + sfCursorSizeTopLeftBottomRight, ///< Double arrow cursor going from top-left to bottom-right + sfCursorSizeBottomLeftTopRight, ///< Double arrow cursor going from bottom-left to top-right + sfCursorSizeAll, ///< Combination of SizeHorizontal and SizeVertical + sfCursorCross, ///< Crosshair cursor + sfCursorHelp, ///< Help cursor + sfCursorNotAllowed ///< Action not allowed cursor +} sfCursorType; + + +//////////////////////////////////////////////////////////// +/// \brief Create a cursor with the provided image +/// +/// \a pixels must be an array of \a width by \a height pixels +/// in 32-bit RGBA format. If not, this will cause undefined behavior. +/// +/// If \a pixels is null or either \a width or \a height are 0, +/// the current cursor is left unchanged and the function will +/// return false. +/// +/// In addition to specifying the pixel data, you can also +/// specify the location of the hotspot of the cursor. The +/// hotspot is the pixel coordinate within the cursor image +/// which will be located exactly where the mouse pointer +/// position is. Any mouse actions that are performed will +/// return the window/screen location of the hotspot. +/// +/// \warning On Unix, the pixels are mapped into a monochrome +/// bitmap: pixels with an alpha channel to 0 are +/// transparent, black if the RGB channel are close +/// to zero, and white otherwise. +/// +/// \param pixels Array of pixels of the image +/// \param size Width and height of the image +/// \param hotspot (x,y) location of the hotspot +/// \return A new sfCursor object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfCursor* sfCursor_createFromPixels(const sfUint8* pixels, sfVector2u size, sfVector2u hotspot); + + +//////////////////////////////////////////////////////////// +/// \brief Create a native system cursor +/// +/// Refer to the list of cursor available on each system +/// (see sfCursorType) to know whether a given cursor is +/// expected to load successfully or is not supported by +/// the operating system. +/// +/// \param type Native system cursor type +/// \return A new sfCursor object +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API sfCursor* sfCursor_createFromSystem(sfCursorType type); + + +//////////////////////////////////////////////////////////// +/// \brief Destroy a cursor +/// +/// \param cursor Cursor to destroy +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfCursor_destroy(sfCursor* cursor); + + +#endif // SFML_CURSOR_H diff --git a/include/SFML/Window/Event.h b/include/SFML/Window/Event.h index 49370d7..a99d78b 100644 --- a/include/SFML/Window/Event.h +++ b/include/SFML/Window/Event.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Export.h b/include/SFML/Window/Export.h index 42e51f6..6a509ab 100644 --- a/include/SFML/Window/Export.h +++ b/include/SFML/Window/Export.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Joystick.h b/include/SFML/Window/Joystick.h index d2beb56..76dadd1 100644 --- a/include/SFML/Window/Joystick.h +++ b/include/SFML/Window/Joystick.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/JoystickIdentification.h b/include/SFML/Window/JoystickIdentification.h index 533e14a..26cfac6 100644 --- a/include/SFML/Window/JoystickIdentification.h +++ b/include/SFML/Window/JoystickIdentification.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Keyboard.h b/include/SFML/Window/Keyboard.h index 9e79155..46c2978 100644 --- a/include/SFML/Window/Keyboard.h +++ b/include/SFML/Window/Keyboard.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -86,18 +86,18 @@ typedef enum sfKeyMenu, ///< The Menu key sfKeyLBracket, ///< The [ key sfKeyRBracket, ///< The ] key - sfKeySemiColon, ///< The ; key + sfKeySemicolon, ///< The ; key sfKeyComma, ///< The , key sfKeyPeriod, ///< The . key sfKeyQuote, ///< The ' key sfKeySlash, ///< The / key - sfKeyBackSlash, ///< The \ key + sfKeyBackslash, ///< The \ key sfKeyTilde, ///< The ~ key sfKeyEqual, ///< The = key - sfKeyDash, ///< The - key + sfKeyHyphen, ///< The - key (hyphen) sfKeySpace, ///< The Space key - sfKeyReturn, ///< The Return key - sfKeyBack, ///< The Backspace key + sfKeyEnter, ///< The Enter/Return key + sfKeyBackspace, ///< The Backspace key sfKeyTab, ///< The Tabulation key sfKeyPageUp, ///< The Page up key sfKeyPageDown, ///< The Page down key @@ -105,10 +105,10 @@ typedef enum sfKeyHome, ///< The Home key sfKeyInsert, ///< The Insert key sfKeyDelete, ///< The Delete key - sfKeyAdd, ///< + - sfKeySubtract, ///< - - sfKeyMultiply, ///< * - sfKeyDivide, ///< / + sfKeyAdd, ///< The + key + sfKeySubtract, ///< The - key (minus, usually from numpad) + sfKeyMultiply, ///< The * key + sfKeyDivide, ///< The / key sfKeyLeft, ///< Left arrow sfKeyRight, ///< Right arrow sfKeyUp, ///< Up arrow @@ -140,7 +140,15 @@ typedef enum sfKeyF15, ///< The F15 key sfKeyPause, ///< The Pause key - sfKeyCount ///< Keep last -- the total number of keyboard keys + sfKeyCount, ///< Keep last -- the total number of keyboard keys + + // Deprecated values: + + sfKeyDash = sfKeyHyphen, ///< \deprecated Use Hyphen instead + sfKeyBack = sfKeyBackspace, ///< \deprecated Use Backspace instead + sfKeyBackSlash = sfKeyBackslash, ///< \deprecated Use Backslash instead + sfKeySemiColon = sfKeySemicolon, ///< \deprecated Use Semicolon instead + sfKeyReturn = sfKeyEnter ///< \deprecated Use Enter instead } sfKeyCode; diff --git a/include/SFML/Window/Mouse.h b/include/SFML/Window/Mouse.h index 2dfb7ce..c8ee5b3 100644 --- a/include/SFML/Window/Mouse.h +++ b/include/SFML/Window/Mouse.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Sensor.h b/include/SFML/Window/Sensor.h index c0d6f37..fa03811 100644 --- a/include/SFML/Window/Sensor.h +++ b/include/SFML/Window/Sensor.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Touch.h b/include/SFML/Window/Touch.h index 52a05f2..4613c00 100644 --- a/include/SFML/Window/Touch.h +++ b/include/SFML/Window/Touch.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Types.h b/include/SFML/Window/Types.h index 21152a9..23614a8 100644 --- a/include/SFML/Window/Types.h +++ b/include/SFML/Window/Types.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -27,6 +27,7 @@ typedef struct sfContext sfContext; +typedef struct sfCursor sfCursor; typedef struct sfWindow sfWindow; diff --git a/include/SFML/Window/VideoMode.h b/include/SFML/Window/VideoMode.h index 90f9b8e..679cf63 100644 --- a/include/SFML/Window/VideoMode.h +++ b/include/SFML/Window/VideoMode.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/include/SFML/Window/Window.h b/include/SFML/Window/Window.h index 5333633..f5ac85b 100644 --- a/include/SFML/Window/Window.h +++ b/include/SFML/Window/Window.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -354,6 +354,26 @@ CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool vi //////////////////////////////////////////////////////////// CSFML_WINDOW_API void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed); +//////////////////////////////////////////////////////////// +/// \brief Set the displayed cursor to a native system cursor +/// +/// Upon window creation, the arrow cursor is used by default. +/// +/// \warning The cursor must not be destroyed while in use by +/// the window. +/// +/// \warning Features related to Cursor are not supported on +/// iOS and Android. +/// +/// \param window Window object +/// \param cursor Native system cursor type to display +/// +/// \see sfCursor_createFromSystem +/// \see sfCursor_createFromPixels +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfWindow_setMouseCursor(sfWindow* window, const sfCursor* cursor); + //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat /// diff --git a/include/SFML/Window/WindowHandle.h b/include/SFML/Window/WindowHandle.h index 98f6c39..8572d9e 100644 --- a/include/SFML/Window/WindowHandle.h +++ b/include/SFML/Window/WindowHandle.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/license.txt b/license.txt index 0b54e3f..8507208 100644 --- a/license.txt +++ b/license.txt @@ -1,7 +1,7 @@ CSFML ----- -CSFML - Copyright (C) 2007-2015 Laurent Gomila - laurent@sfml-dev.org +CSFML - Copyright (C) 2007-2018 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 diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt index 416d39c..b661d60 100644 --- a/src/SFML/Audio/CMakeLists.txt +++ b/src/SFML/Audio/CMakeLists.txt @@ -32,4 +32,4 @@ set(SRC # define the csfml-audio target csfml_add_library(csfml-audio SOURCES ${SRC} - DEPENDS ${SFML_AUDIO_LIBRARY} ${SFML_SYSTEM_LIBRARY} ${SFML_AUDIO_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES}) + DEPENDS sfml-audio) diff --git a/src/SFML/Audio/Listener.cpp b/src/SFML/Audio/Listener.cpp index cdb9ddf..1de12ad 100644 --- a/src/SFML/Audio/Listener.cpp +++ b/src/SFML/Audio/Listener.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/Music.cpp b/src/SFML/Audio/Music.cpp index 3c08979..a7746d7 100644 --- a/src/SFML/Audio/Music.cpp +++ b/src/SFML/Audio/Music.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -107,6 +107,29 @@ sfTime sfMusic_getDuration(const sfMusic* music) } +//////////////////////////////////////////////////////////// +sfTimeSpan sfMusic_getLoopPoints(const sfMusic* music) +{ + sfTimeSpan timeSpan = {{0}, {0}}; + CSFML_CHECK_RETURN(music, timeSpan); + + sf::Music::TimeSpan span = music->This.getLoopPoints(); + + timeSpan.offset.microseconds = span.offset.asMicroseconds(); + timeSpan.length.microseconds = span.length.asMicroseconds(); + + return timeSpan; +} + + +//////////////////////////////////////////////////////////// +void sfMusic_setLoopPoints(sfMusic* music, sfTimeSpan timePoints) +{ + CSFML_CALL(music, setLoopPoints(sf::Music::TimeSpan(sf::microseconds(timePoints.offset.microseconds), + sf::microseconds(timePoints.length.microseconds)))); +} + + //////////////////////////////////////////////////////////// void sfMusic_play(sfMusic* music) { diff --git a/src/SFML/Audio/MusicStruct.h b/src/SFML/Audio/MusicStruct.h index 34fe485..fbfe98a 100644 --- a/src/SFML/Audio/MusicStruct.h +++ b/src/SFML/Audio/MusicStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/Sound.cpp b/src/SFML/Audio/Sound.cpp index 2909b4e..71f6c92 100644 --- a/src/SFML/Audio/Sound.cpp +++ b/src/SFML/Audio/Sound.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp index e3510bf..0ee1ac4 100644 --- a/src/SFML/Audio/SoundBuffer.cpp +++ b/src/SFML/Audio/SoundBuffer.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundBufferRecorder.cpp b/src/SFML/Audio/SoundBufferRecorder.cpp index 94e1b84..0c50057 100644 --- a/src/SFML/Audio/SoundBufferRecorder.cpp +++ b/src/SFML/Audio/SoundBufferRecorder.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundBufferRecorderStruct.h b/src/SFML/Audio/SoundBufferRecorderStruct.h index 322c50a..5ac3e3a 100644 --- a/src/SFML/Audio/SoundBufferRecorderStruct.h +++ b/src/SFML/Audio/SoundBufferRecorderStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundBufferStruct.h b/src/SFML/Audio/SoundBufferStruct.h index 33b38f4..764ac8e 100644 --- a/src/SFML/Audio/SoundBufferStruct.h +++ b/src/SFML/Audio/SoundBufferStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundRecorder.cpp b/src/SFML/Audio/SoundRecorder.cpp index 69a59fd..a705f97 100644 --- a/src/SFML/Audio/SoundRecorder.cpp +++ b/src/SFML/Audio/SoundRecorder.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundRecorderStruct.h b/src/SFML/Audio/SoundRecorderStruct.h index d18aaa9..f614559 100644 --- a/src/SFML/Audio/SoundRecorderStruct.h +++ b/src/SFML/Audio/SoundRecorderStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index cfc089c..3077d70 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundStreamStruct.h b/src/SFML/Audio/SoundStreamStruct.h index 6543cd6..16b9a4b 100644 --- a/src/SFML/Audio/SoundStreamStruct.h +++ b/src/SFML/Audio/SoundStreamStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Audio/SoundStruct.h b/src/SFML/Audio/SoundStruct.h index a9d695f..3cf5a4c 100644 --- a/src/SFML/Audio/SoundStruct.h +++ b/src/SFML/Audio/SoundStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/CMakeLists.txt b/src/SFML/CMakeLists.txt index 1c97187..bcc0962 100644 --- a/src/SFML/CMakeLists.txt +++ b/src/SFML/CMakeLists.txt @@ -23,8 +23,7 @@ if(SFML_OS_WINDOWS) add_definitions(-DSFML_STATIC) endif() endif() -find_package(SFML 2 COMPONENTS system window network graphics audio REQUIRED) -include_directories(${SFML_INCLUDE_DIR}) +find_package(SFML 2 COMPONENTS network graphics audio REQUIRED) # add the modules subdirectories add_subdirectory(System) diff --git a/src/SFML/CallbackStream.h b/src/SFML/CallbackStream.h index 1c5add8..c64bd89 100644 --- a/src/SFML/CallbackStream.h +++ b/src/SFML/CallbackStream.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/ConvertEvent.h b/src/SFML/ConvertEvent.h index 6971d62..3a84759 100644 --- a/src/SFML/ConvertEvent.h +++ b/src/SFML/ConvertEvent.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/BlendMode.cpp b/src/SFML/Graphics/BlendMode.cpp index 0f8fcea..ccb0ac4 100644 --- a/src/SFML/Graphics/BlendMode.cpp +++ b/src/SFML/Graphics/BlendMode.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt index a68ce3b..5e56f32 100644 --- a/src/SFML/Graphics/CMakeLists.txt +++ b/src/SFML/Graphics/CMakeLists.txt @@ -61,6 +61,9 @@ set(SRC ${SRCROOT}/VertexArray.cpp ${SRCROOT}/VertexArrayStruct.h ${INCROOT}/VertexArray.h + ${INCROOT}/VertexBuffer.h + ${SRCROOT}/VertexBuffer.cpp + ${SRCROOT}/VertexBufferStruct.h ${SRCROOT}/View.cpp ${SRCROOT}/ViewStruct.h ${INCROOT}/View.h @@ -69,4 +72,4 @@ set(SRC # define the csfml-graphics target csfml_add_library(csfml-graphics SOURCES ${SRC} - DEPENDS ${SFML_GRAPHICS_LIBRARY} ${SFML_WINDOW_LIBRARY} ${SFML_SYSTEM_LIBRARY} ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_WINDOW_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES}) + DEPENDS sfml-graphics) diff --git a/src/SFML/Graphics/CircleShape.cpp b/src/SFML/Graphics/CircleShape.cpp index 707a74b..4ff5f52 100644 --- a/src/SFML/Graphics/CircleShape.cpp +++ b/src/SFML/Graphics/CircleShape.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/CircleShapeStruct.h b/src/SFML/Graphics/CircleShapeStruct.h index b0740a4..9380fc8 100644 --- a/src/SFML/Graphics/CircleShapeStruct.h +++ b/src/SFML/Graphics/CircleShapeStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Color.cpp b/src/SFML/Graphics/Color.cpp index d3b24d3..0212aac 100644 --- a/src/SFML/Graphics/Color.cpp +++ b/src/SFML/Graphics/Color.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ConvertRenderStates.hpp b/src/SFML/Graphics/ConvertRenderStates.hpp index 2d34ca4..ccbc1ce 100644 --- a/src/SFML/Graphics/ConvertRenderStates.hpp +++ b/src/SFML/Graphics/ConvertRenderStates.hpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ConvertTransform.hpp b/src/SFML/Graphics/ConvertTransform.hpp index fddef6b..7054cc1 100644 --- a/src/SFML/Graphics/ConvertTransform.hpp +++ b/src/SFML/Graphics/ConvertTransform.hpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ConvexShape.cpp b/src/SFML/Graphics/ConvexShape.cpp index 90336bf..371a592 100644 --- a/src/SFML/Graphics/ConvexShape.cpp +++ b/src/SFML/Graphics/ConvexShape.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ConvexShapeStruct.h b/src/SFML/Graphics/ConvexShapeStruct.h index 01ecb62..25c751c 100644 --- a/src/SFML/Graphics/ConvexShapeStruct.h +++ b/src/SFML/Graphics/ConvexShapeStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 9fffeb8..2c98ee3 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/FontStruct.h b/src/SFML/Graphics/FontStruct.h index ec499bf..0126c67 100644 --- a/src/SFML/Graphics/FontStruct.h +++ b/src/SFML/Graphics/FontStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp index e251f6f..958301d 100644 --- a/src/SFML/Graphics/Image.cpp +++ b/src/SFML/Graphics/Image.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ImageStruct.h b/src/SFML/Graphics/ImageStruct.h index 46b1423..1500f45 100644 --- a/src/SFML/Graphics/ImageStruct.h +++ b/src/SFML/Graphics/ImageStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Rect.cpp b/src/SFML/Graphics/Rect.cpp index be88363..87b03a0 100644 --- a/src/SFML/Graphics/Rect.cpp +++ b/src/SFML/Graphics/Rect.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/RectangleShape.cpp b/src/SFML/Graphics/RectangleShape.cpp index 17de250..b69a0e1 100644 --- a/src/SFML/Graphics/RectangleShape.cpp +++ b/src/SFML/Graphics/RectangleShape.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/RectangleShapeStruct.h b/src/SFML/Graphics/RectangleShapeStruct.h index 97a3fab..f0a163a 100644 --- a/src/SFML/Graphics/RectangleShapeStruct.h +++ b/src/SFML/Graphics/RectangleShapeStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/RenderTexture.cpp b/src/SFML/Graphics/RenderTexture.cpp index 57b5554..00f76b4 100644 --- a/src/SFML/Graphics/RenderTexture.cpp +++ b/src/SFML/Graphics/RenderTexture.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -34,8 +34,10 @@ #include #include #include +#include #include #include +#include //////////////////////////////////////////////////////////// @@ -51,6 +53,27 @@ sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, } +//////////////////////////////////////////////////////////// +sfRenderTexture* sfRenderTexture_createWithSettings(unsigned int width, unsigned int height, const sfContextSettings* settings) +{ + // Convert context settings + sf::ContextSettings params; + if (settings) + { + priv::sfContextSettings_writeToCpp(*settings, params); + } + + // Create the render texture + sfRenderTexture* renderTexture = new sfRenderTexture; + renderTexture->This.create(width, height, params); + renderTexture->Target = new sfTexture(const_cast(&renderTexture->This.getTexture())); + renderTexture->DefaultView.This = renderTexture->This.getDefaultView(); + renderTexture->CurrentView.This = renderTexture->This.getView(); + + return renderTexture; +} + + //////////////////////////////////////////////////////////// void sfRenderTexture_destroy(sfRenderTexture* renderTexture) { @@ -214,6 +237,11 @@ void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVer CSFML_CHECK(object); CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } +void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, const sfVertexBuffer* object, const sfRenderStates* states) +{ + CSFML_CHECK(object); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); +} //////////////////////////////////////////////////////////// @@ -263,6 +291,13 @@ void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth) } +//////////////////////////////////////////////////////////// +unsigned int sfRenderTexture_getMaximumAntialiasingLevel() +{ + return sf::RenderTexture::getMaximumAntialiasingLevel(); +} + + //////////////////////////////////////////////////////////// sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture) { diff --git a/src/SFML/Graphics/RenderTextureStruct.h b/src/SFML/Graphics/RenderTextureStruct.h index 9134037..f1c68d2 100644 --- a/src/SFML/Graphics/RenderTextureStruct.h +++ b/src/SFML/Graphics/RenderTextureStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp index b1fa344..8b729cd 100644 --- a/src/SFML/Graphics/RenderWindow.cpp +++ b/src/SFML/Graphics/RenderWindow.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -35,10 +35,12 @@ #include #include #include +#include #include #include #include #include +#include #include @@ -274,6 +276,15 @@ void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool g } +//////////////////////////////////////////////////////////// +void sfRenderWindow_setMouseCursor(sfRenderWindow* window, const sfCursor* cursor) +{ + CSFML_CHECK(cursor); + + CSFML_CALL(window, setMouseCursor(cursor->This)); +} + + //////////////////////////////////////////////////////////// void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled) { @@ -459,6 +470,11 @@ void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertex CSFML_CHECK(object); CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } +void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVertexBuffer* object, const sfRenderStates* states) +{ + CSFML_CHECK(object); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); +} //////////////////////////////////////////////////////////// diff --git a/src/SFML/Graphics/RenderWindowStruct.h b/src/SFML/Graphics/RenderWindowStruct.h index ee7cc93..9b1582a 100644 --- a/src/SFML/Graphics/RenderWindowStruct.h +++ b/src/SFML/Graphics/RenderWindowStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index fdaeb32..a8a35c9 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ShaderStruct.h b/src/SFML/Graphics/ShaderStruct.h index 1d9a77f..cd8e330 100644 --- a/src/SFML/Graphics/ShaderStruct.h +++ b/src/SFML/Graphics/ShaderStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp index d7647c3..87cda25 100644 --- a/src/SFML/Graphics/Shape.cpp +++ b/src/SFML/Graphics/Shape.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ShapeStruct.h b/src/SFML/Graphics/ShapeStruct.h index 9f48f65..34f1b51 100644 --- a/src/SFML/Graphics/ShapeStruct.h +++ b/src/SFML/Graphics/ShapeStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp index 553ea09..c9dc664 100644 --- a/src/SFML/Graphics/Sprite.cpp +++ b/src/SFML/Graphics/Sprite.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/SpriteStruct.h b/src/SFML/Graphics/SpriteStruct.h index b70e1a0..8e37bd9 100644 --- a/src/SFML/Graphics/SpriteStruct.h +++ b/src/SFML/Graphics/SpriteStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Text.cpp b/src/SFML/Graphics/Text.cpp index 27578ed..9ee5e14 100644 --- a/src/SFML/Graphics/Text.cpp +++ b/src/SFML/Graphics/Text.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -209,6 +209,20 @@ void sfText_setCharacterSize(sfText* text, unsigned int size) } +//////////////////////////////////////////////////////////// +void sfText_setLineSpacing(sfText* text, float spacingFactor) +{ + CSFML_CALL(text, setLineSpacing(spacingFactor)); +} + + +//////////////////////////////////////////////////////////// +void sfText_setLetterSpacing(sfText* text, float spacingFactor) +{ + CSFML_CALL(text, setLetterSpacing(spacingFactor)); +} + + //////////////////////////////////////////////////////////// void sfText_setStyle(sfText* text, sfUint32 style) { @@ -280,6 +294,21 @@ unsigned int sfText_getCharacterSize(const sfText* text) } +//////////////////////////////////////////////////////////// +float sfText_getLetterSpacing(const sfText* text) +{ + CSFML_CALL_RETURN(text, getLetterSpacing(), 1); +} + + +//////////////////////////////////////////////////////////// +float sfText_getLineSpacing(const sfText* text) +{ + CSFML_CALL_RETURN(text, getLineSpacing(), 1); +} + + + //////////////////////////////////////////////////////////// sfUint32 sfText_getStyle(const sfText* text) { diff --git a/src/SFML/Graphics/TextStruct.h b/src/SFML/Graphics/TextStruct.h index 428dca4..5560dbb 100644 --- a/src/SFML/Graphics/TextStruct.h +++ b/src/SFML/Graphics/TextStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index a224351..18bc123 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -38,7 +38,7 @@ sfTexture* sfTexture_create(unsigned int width, unsigned int height) { sfTexture* texture = new sfTexture; - + if (!texture->This->create(width, height)) { delete texture; @@ -263,6 +263,15 @@ sfBool sfTexture_generateMipmap(sfTexture* texture) } +//////////////////////////////////////////////////////////// +void sfTexture_swap(sfTexture* left, sfTexture* right) +{ + CSFML_CHECK(right); + + CSFML_CALL_PTR(left, swap(*right->This)); +} + + //////////////////////////////////////////////////////////// unsigned int sfTexture_getNativeHandle(const sfTexture* texture) { diff --git a/src/SFML/Graphics/TextureStruct.h b/src/SFML/Graphics/TextureStruct.h index 5c20525..1095456 100644 --- a/src/SFML/Graphics/TextureStruct.h +++ b/src/SFML/Graphics/TextureStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/Transform.cpp b/src/SFML/Graphics/Transform.cpp index 83a98c9..675471f 100644 --- a/src/SFML/Graphics/Transform.cpp +++ b/src/SFML/Graphics/Transform.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -156,3 +156,14 @@ void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float sca *transform = convertTransform(convertTransform(*transform).scale(scaleX, scaleY, centerX, centerY)); } + + +//////////////////////////////////////////////////////////// +sfBool sfTransform_equal(sfTransform* left, sfTransform* right) +{ + CSFML_CHECK_RETURN(left, false); + CSFML_CHECK_RETURN(right, false); + + return (left->matrix == right->matrix) ? sfTrue : sfFalse; +} + diff --git a/src/SFML/Graphics/Transformable.cpp b/src/SFML/Graphics/Transformable.cpp index 4a8f943..369bea2 100644 --- a/src/SFML/Graphics/Transformable.cpp +++ b/src/SFML/Graphics/Transformable.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/TransformableStruct.h b/src/SFML/Graphics/TransformableStruct.h index 382e76f..d07fa11 100644 --- a/src/SFML/Graphics/TransformableStruct.h +++ b/src/SFML/Graphics/TransformableStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/VertexArray.cpp b/src/SFML/Graphics/VertexArray.cpp index d9b911c..d84bd4c 100644 --- a/src/SFML/Graphics/VertexArray.cpp +++ b/src/SFML/Graphics/VertexArray.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/VertexArrayStruct.h b/src/SFML/Graphics/VertexArrayStruct.h index fffba5f..204ee3e 100644 --- a/src/SFML/Graphics/VertexArrayStruct.h +++ b/src/SFML/Graphics/VertexArrayStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/VertexBuffer.cpp b/src/SFML/Graphics/VertexBuffer.cpp new file mode 100644 index 0000000..0562e49 --- /dev/null +++ b/src/SFML/Graphics/VertexBuffer.cpp @@ -0,0 +1,148 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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. +// +//////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + + +//////////////////////////////////////////////////////////// +sfVertexBuffer* sfVertexBuffer_create(unsigned int vertexCount, sfPrimitiveType type, sfVertexBufferUsage usage) +{ + sfVertexBuffer* buffer = new sfVertexBuffer; + + if (!buffer->This.create(vertexCount)) + { + delete buffer; + buffer = NULL; + } + else + { + buffer->This.setPrimitiveType(static_cast(type)); + buffer->This.setUsage(static_cast(usage)); + } + + return buffer; +} + + +//////////////////////////////////////////////////////////// +sfVertexBuffer* sfVertexBuffer_copy(const sfVertexBuffer* vertexBuffer) +{ + sfVertexBuffer* buffer = new sfVertexBuffer; + buffer->This = sf::VertexBuffer( vertexBuffer->This ); + return buffer; +} + + +//////////////////////////////////////////////////////////// +void sfVertexBuffer_destroy(sfVertexBuffer* vertexBuffer) +{ + delete vertexBuffer; +} + + +//////////////////////////////////////////////////////////// +unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer* vertexBuffer) +{ + CSFML_CALL_RETURN(vertexBuffer, getVertexCount(), 0); +} + + +//////////////////////////////////////////////////////////// +sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset) +{ + // the cast is safe, sfVertex has to be binary compatible with sf::Vertex + CSFML_CALL_RETURN(vertexBuffer, update(reinterpret_cast(vertices), vertexCount, offset), sfFalse); +} + + +//////////////////////////////////////////////////////////// +sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other) +{ + CSFML_CALL_RETURN(vertexBuffer, update(other->This), sfFalse); +} + + +/////////////////////////////////////////////////////////// +void sfVertexBuffer_swap(sfVertexBuffer* left, sfVertexBuffer* right) +{ + CSFML_CHECK(right); + + CSFML_CALL(left, swap(right->This)); +} + + +//////////////////////////////////////////////////////////// +unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer* vertexBuffer) +{ + CSFML_CALL_RETURN(vertexBuffer, getNativeHandle(), 0); +} + + +//////////////////////////////////////////////////////////// +void sfVertexBuffer_setPrimitiveType(sfVertexBuffer* vertexBuffer, sfPrimitiveType type) +{ + CSFML_CALL(vertexBuffer, setPrimitiveType(static_cast(type))); +} + + +//////////////////////////////////////////////////////////// +sfPrimitiveType sfVertexBuffer_getPrimitiveType(const sfVertexBuffer* vertexBuffer) +{ + CSFML_CHECK_RETURN(vertexBuffer, sfPoints); + return static_cast(vertexBuffer->This.getPrimitiveType()); +} + + +//////////////////////////////////////////////////////////// +void sfVertexBuffer_setUsage(sfVertexBuffer* vertexBuffer, sfVertexBufferUsage usage) +{ + CSFML_CALL(vertexBuffer, setUsage(static_cast(usage))); +} + + +//////////////////////////////////////////////////////////// +sfVertexBufferUsage sfVertexBuffer_getUsage(const sfVertexBuffer* vertexBuffer) +{ + CSFML_CHECK_RETURN(vertexBuffer, sfVertexBufferStream); + return static_cast(vertexBuffer->This.getUsage()); +} + + +//////////////////////////////////////////////////////////// +void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer) +{ + sf::VertexBuffer::bind(&vertexBuffer->This); +} + + +//////////////////////////////////////////////////////////// +sfBool sfVertexBuffer_isAvailable() +{ + return sf::VertexBuffer::isAvailable() ? sfTrue : sfFalse; +} diff --git a/src/SFML/Graphics/VertexBufferStruct.h b/src/SFML/Graphics/VertexBufferStruct.h new file mode 100644 index 0000000..9b4659e --- /dev/null +++ b/src/SFML/Graphics/VertexBufferStruct.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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_VERTEXBUFFERSTRUCT_H +#define SFML_VERTEXBUFFERSTRUCT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include + + +//////////////////////////////////////////////////////////// +// Internal structure of sfVertexBuffer +//////////////////////////////////////////////////////////// +struct sfVertexBuffer +{ + sf::VertexBuffer This; +}; + + +#endif // SFML_VERTEXBUFFERSTRUCT_H diff --git a/src/SFML/Graphics/View.cpp b/src/SFML/Graphics/View.cpp index 51db39d..97605ce 100644 --- a/src/SFML/Graphics/View.cpp +++ b/src/SFML/Graphics/View.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Graphics/ViewStruct.h b/src/SFML/Graphics/ViewStruct.h index 7772937..bd0f6ab 100644 --- a/src/SFML/Graphics/ViewStruct.h +++ b/src/SFML/Graphics/ViewStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Internal.h b/src/SFML/Internal.h index b6742a4..98babeb 100644 --- a/src/SFML/Internal.h +++ b/src/SFML/Internal.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Main/SFML_Main.cpp b/src/SFML/Main/SFML_Main.cpp index fc35483..7fdb62a 100644 --- a/src/SFML/Main/SFML_Main.cpp +++ b/src/SFML/Main/SFML_Main.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/CMakeLists.txt b/src/SFML/Network/CMakeLists.txt index a9d3030..cda03eb 100644 --- a/src/SFML/Network/CMakeLists.txt +++ b/src/SFML/Network/CMakeLists.txt @@ -35,4 +35,4 @@ set(SRC # define the csfml-network target csfml_add_library(csfml-network SOURCES ${SRC} - DEPENDS ${SFML_NETWORK_LIBRARY} ${SFML_SYSTEM_LIBRARY} ${SFML_NETWORK_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES}) + DEPENDS sfml-network) diff --git a/src/SFML/Network/Ftp.cpp b/src/SFML/Network/Ftp.cpp index 5916668..a44094a 100644 --- a/src/SFML/Network/Ftp.cpp +++ b/src/SFML/Network/Ftp.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -299,13 +299,14 @@ sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* lo //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode) +sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, sfBool append) { CSFML_CHECK_RETURN(ftp, NULL); return new sfFtpResponse(ftp->This.upload(localFile ? localFile : "", remotePath ? remotePath : "", - static_cast(mode))); + static_cast(mode), + append == sfTrue)); } diff --git a/src/SFML/Network/FtpStruct.h b/src/SFML/Network/FtpStruct.h index a751db0..c1fb641 100644 --- a/src/SFML/Network/FtpStruct.h +++ b/src/SFML/Network/FtpStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index bf1a3b2..8afc6a4 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/HttpStruct.h b/src/SFML/Network/HttpStruct.h index 77ee881..26640f8 100644 --- a/src/SFML/Network/HttpStruct.h +++ b/src/SFML/Network/HttpStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/IpAddress.cpp b/src/SFML/Network/IpAddress.cpp index 07bfe71..dd4ba99 100644 --- a/src/SFML/Network/IpAddress.cpp +++ b/src/SFML/Network/IpAddress.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index e69be45..708929d 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/PacketStruct.h b/src/SFML/Network/PacketStruct.h index f892517..982eee9 100644 --- a/src/SFML/Network/PacketStruct.h +++ b/src/SFML/Network/PacketStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/SocketSelector.cpp b/src/SFML/Network/SocketSelector.cpp index 484e3c1..652f76f 100644 --- a/src/SFML/Network/SocketSelector.cpp +++ b/src/SFML/Network/SocketSelector.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/SocketSelectorStruct.h b/src/SFML/Network/SocketSelectorStruct.h index af76cc4..14bc822 100644 --- a/src/SFML/Network/SocketSelectorStruct.h +++ b/src/SFML/Network/SocketSelectorStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/TcpListener.cpp b/src/SFML/Network/TcpListener.cpp index f64a0d2..5468685 100644 --- a/src/SFML/Network/TcpListener.cpp +++ b/src/SFML/Network/TcpListener.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/TcpListenerStruct.h b/src/SFML/Network/TcpListenerStruct.h index fe47ff8..13fc7c7 100644 --- a/src/SFML/Network/TcpListenerStruct.h +++ b/src/SFML/Network/TcpListenerStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 1d4e015..fa2a222 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/TcpSocketStruct.h b/src/SFML/Network/TcpSocketStruct.h index 37b867a..1ca53b8 100644 --- a/src/SFML/Network/TcpSocketStruct.h +++ b/src/SFML/Network/TcpSocketStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/UdpSocket.cpp b/src/SFML/Network/UdpSocket.cpp index 60dd518..13c54de 100644 --- a/src/SFML/Network/UdpSocket.cpp +++ b/src/SFML/Network/UdpSocket.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Network/UdpSocketStruct.h b/src/SFML/Network/UdpSocketStruct.h index de06d48..adcccbc 100644 --- a/src/SFML/Network/UdpSocketStruct.h +++ b/src/SFML/Network/UdpSocketStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/CMakeLists.txt b/src/SFML/System/CMakeLists.txt index d227862..2e62ec1 100644 --- a/src/SFML/System/CMakeLists.txt +++ b/src/SFML/System/CMakeLists.txt @@ -4,6 +4,7 @@ set(SRCROOT ${CMAKE_SOURCE_DIR}/src/SFML/System) # all source files set(SRC + ${CMAKE_SOURCE_DIR}/include/SFML/GPUPreference.h ${INCROOT}/Export.h ${SRCROOT}/Clock.cpp ${SRCROOT}/ClockStruct.h @@ -27,4 +28,4 @@ set(SRC # define the csfml-system target csfml_add_library(csfml-system SOURCES ${SRC} - DEPENDS ${SFML_SYSTEM_LIBRARY} ${SFML_SYSTEM_DEPENDENCIES}) + DEPENDS sfml-system) diff --git a/src/SFML/System/Clock.cpp b/src/SFML/System/Clock.cpp index 9eb5dda..60c784a 100644 --- a/src/SFML/System/Clock.cpp +++ b/src/SFML/System/Clock.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/ClockStruct.h b/src/SFML/System/ClockStruct.h index fe13495..5ed64b0 100644 --- a/src/SFML/System/ClockStruct.h +++ b/src/SFML/System/ClockStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/Mutex.cpp b/src/SFML/System/Mutex.cpp index 4d820e7..6579c49 100644 --- a/src/SFML/System/Mutex.cpp +++ b/src/SFML/System/Mutex.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/MutexStruct.h b/src/SFML/System/MutexStruct.h index 2e2e2d8..ffc72b6 100644 --- a/src/SFML/System/MutexStruct.h +++ b/src/SFML/System/MutexStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/Sleep.cpp b/src/SFML/System/Sleep.cpp index 92dee43..6ad7b47 100644 --- a/src/SFML/System/Sleep.cpp +++ b/src/SFML/System/Sleep.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/Thread.cpp b/src/SFML/System/Thread.cpp index 6af08fb..37eebf7 100644 --- a/src/SFML/System/Thread.cpp +++ b/src/SFML/System/Thread.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/ThreadStruct.h b/src/SFML/System/ThreadStruct.h index 5b811b1..902f4c3 100644 --- a/src/SFML/System/ThreadStruct.h +++ b/src/SFML/System/ThreadStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/System/Time.cpp b/src/SFML/System/Time.cpp index 72c682c..7a2e2ea 100644 --- a/src/SFML/System/Time.cpp +++ b/src/SFML/System/Time.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt index ee0d89a..6438ce3 100644 --- a/src/SFML/Window/CMakeLists.txt +++ b/src/SFML/Window/CMakeLists.txt @@ -5,6 +5,11 @@ set(SRCROOT ${CMAKE_SOURCE_DIR}/src/SFML/Window) # all source files set(SRC ${INCROOT}/Export.h + ${INCROOT}/Clipboard.h + ${SRCROOT}/Clipboard.cpp + ${INCROOT}/Cursor.h + ${SRCROOT}/Cursor.cpp + ${SRCROOT}/CursorStruct.h ${SRCROOT}/Context.cpp ${SRCROOT}/ContextSettingsInternal.h ${SRCROOT}/ContextStruct.h @@ -33,4 +38,4 @@ set(SRC # define the csfml-window target csfml_add_library(csfml-window SOURCES ${SRC} - DEPENDS ${SFML_WINDOW_LIBRARY} ${SFML_SYSTEM_LIBRARY} ${SFML_WINDOW_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES}) + DEPENDS sfml-window) diff --git a/src/SFML/Window/Clipboard.cpp b/src/SFML/Window/Clipboard.cpp new file mode 100644 index 0000000..523a8dc --- /dev/null +++ b/src/SFML/Window/Clipboard.cpp @@ -0,0 +1,67 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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. +// +//////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + + +namespace +{ + sf::String ClipboardString; + std::string ClipboardStringAnsi; +} + + +//////////////////////////////////////////////////////////// +const char* sfClipboard_getString() +{ + ClipboardStringAnsi = sf::Clipboard::getString().toAnsiString(); + return ClipboardStringAnsi.c_str(); +} + + +//////////////////////////////////////////////////////////// +const sfUint32* sfClipboard_getUnicodeString() +{ + ClipboardString = sf::Clipboard::getString(); + return ClipboardString.getData(); +} + + +//////////////////////////////////////////////////////////// +void sfClipboard_setString(const char* text) +{ + sf::Clipboard::setString(text); +} + + +//////////////////////////////////////////////////////////// +void sfClipboard_setUnicodeString(const sfUint32* text) +{ + sf::Clipboard::setString(text); +} diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp index c420665..80ccc9b 100644 --- a/src/SFML/Window/Context.cpp +++ b/src/SFML/Window/Context.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -51,6 +51,7 @@ sfBool sfContext_setActive(sfContext* context, sfBool active) CSFML_CALL_RETURN(context, setActive(active == sfTrue), false) } + //////////////////////////////////////////////////////////// sfContextSettings sfContext_getSettings(const sfContext* context) { @@ -62,3 +63,10 @@ sfContextSettings sfContext_getSettings(const sfContext* context) return settings; } + + +//////////////////////////////////////////////////////////// +sfUint64 sfContext_getActiveContextId() +{ + return sf::Context::getActiveContextId(); +} diff --git a/src/SFML/Window/ContextStruct.h b/src/SFML/Window/ContextStruct.h index 859ee3b..e6d196b 100644 --- a/src/SFML/Window/ContextStruct.h +++ b/src/SFML/Window/ContextStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/Cursor.cpp b/src/SFML/Window/Cursor.cpp new file mode 100644 index 0000000..835ac6e --- /dev/null +++ b/src/SFML/Window/Cursor.cpp @@ -0,0 +1,68 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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. +// +//////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + + +//////////////////////////////////////////////////////////// +sfCursor* sfCursor_createFromPixels(const sfUint8* pixels, sfVector2u size, sfVector2u hotspot) +{ + sfCursor* cursor = new sfCursor; + + if (!cursor->This.loadFromPixels(pixels, sf::Vector2u(size.x, size.y), sf::Vector2u(hotspot.x, hotspot.y))) + { + delete cursor; + cursor = NULL; + } + + return cursor; +} + + +//////////////////////////////////////////////////////////// +sfCursor* sfCursor_createFromSystem(sfCursorType type) +{ + sfCursor* cursor = new sfCursor; + + if (!cursor->This.loadFromSystem(static_cast(type))) + { + delete cursor; + cursor = NULL; + } + + return cursor; +} + + +//////////////////////////////////////////////////////////// +void sfCursor_destroy(sfCursor* cursor) +{ + delete cursor; +} + diff --git a/src/SFML/Window/CursorStruct.h b/src/SFML/Window/CursorStruct.h new file mode 100644 index 0000000..3b4c7db --- /dev/null +++ b/src/SFML/Window/CursorStruct.h @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 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_CURSORSTRUCT_H +#define SFML_CURSORSTRUCT_H + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include + + +//////////////////////////////////////////////////////////// +// Internal structure of sfCursor +//////////////////////////////////////////////////////////// +struct sfCursor +{ + sf::Cursor This; +}; + + +#endif // SFML_CURSORSTRUCT_H diff --git a/src/SFML/Window/Joystick.cpp b/src/SFML/Window/Joystick.cpp index 3accb04..9bf4e4f 100644 --- a/src/SFML/Window/Joystick.cpp +++ b/src/SFML/Window/Joystick.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/Keyboard.cpp b/src/SFML/Window/Keyboard.cpp index ff65cfb..d1f0835 100644 --- a/src/SFML/Window/Keyboard.cpp +++ b/src/SFML/Window/Keyboard.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/Mouse.cpp b/src/SFML/Window/Mouse.cpp index fbf0972..1135843 100644 --- a/src/SFML/Window/Mouse.cpp +++ b/src/SFML/Window/Mouse.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/Sensor.cpp b/src/SFML/Window/Sensor.cpp index 0b4570f..ab482d8 100644 --- a/src/SFML/Window/Sensor.cpp +++ b/src/SFML/Window/Sensor.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/Touch.cpp b/src/SFML/Window/Touch.cpp index 3d2b8a7..1f4954e 100644 --- a/src/SFML/Window/Touch.cpp +++ b/src/SFML/Window/Touch.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/VideoMode.cpp b/src/SFML/Window/VideoMode.cpp index 71155fd..f82b68c 100644 --- a/src/SFML/Window/VideoMode.cpp +++ b/src/SFML/Window/VideoMode.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 421010d..96e4d5a 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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. @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -250,6 +251,14 @@ void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed) } +//////////////////////////////////////////////////////////// +void sfWindow_setMouseCursor(sfWindow* window, const sfCursor* cursor) +{ + CSFML_CHECK(cursor); + + CSFML_CALL(window, setMouseCursor(cursor->This)); +} + //////////////////////////////////////////////////////////// void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled) { diff --git a/src/SFML/Window/WindowStruct.h b/src/SFML/Window/WindowStruct.h index 76a89a4..2e271bf 100644 --- a/src/SFML/Window/WindowStruct.h +++ b/src/SFML/Window/WindowStruct.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2018 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.