diff --git a/include/SFML/Graphics/RenderWindow.h b/include/SFML/Graphics/RenderWindow.h index f79d7b0..64a4c23 100644 --- a/include/SFML/Graphics/RenderWindow.h +++ b/include/SFML/Graphics/RenderWindow.h @@ -552,33 +552,6 @@ CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow) //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow); -//////////////////////////////////////////////////////////// -/// \brief Copy the current contents of the window to an image -/// -/// \deprecated -/// Use a sfTexture and its -/// sfTexture_updateFromRenderWindow(sfTexture*, const sfRenderWindow*, unsigned int, unsigned int) -/// function and copy its contents into an sfImage instead. -/// \code -/// sfVector2u windowSize = sfRenderWindow_getSize(window); -/// sfTexture* texture = sfTexture_create(windowSize.x, windowSize.y); -/// sfTexture_updateFromRenderWindow(texture, window, windowSize.x, windowSize.y); -/// sfImage* screenshot = sfTexture_copyToImage(texture); -/// \endcode -/// -/// This is a slow operation, whose main purpose is to make -/// screenshots of the application. If you want to update an -/// image with the contents of the window and then use it for -/// drawing, you should rather use a sfTexture and the -/// sfTexture_updateFromWindow(sfTexture*, const sfWindow*, unsigned int, unsigned int) function. -/// You can also draw things directly to a texture with the -/// sfRenderTexture class. -/// -/// \return sfImage containing the captured contents. -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow); - //////////////////////////////////////////////////////////// /// \brief Get the current position of the mouse relative to a render-window /// diff --git a/include/SFML/Graphics/Shader.h b/include/SFML/Graphics/Shader.h index 02b317f..11d9dda 100644 --- a/include/SFML/Graphics/Shader.h +++ b/include/SFML/Graphics/Shader.h @@ -398,253 +398,6 @@ CSFML_GRAPHICS_API void sfShader_setMat3UniformArray(sfShader* shader, const cha //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfShader_setMat4UniformArray(sfShader* shader, const char* name, const sfGlslMat4* matrixArray, size_t length); -//////////////////////////////////////////////////////////// -/// \brief Change a float parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a float -/// (float GLSL type). -/// -/// Example: -/// \code -/// uniform float myparam; // this is the variable in the shader -/// \endcode -/// \code -/// sfShader_setFloatParameter(shader, "myparam", 5.2f); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param x Value to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloatParameter(sfShader* shader, const char* name, float x); - -//////////////////////////////////////////////////////////// -/// \brief Change a 2-components vector parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 2x1 vector -/// (vec2 GLSL type). -/// -/// Example: -/// \code -/// uniform vec2 myparam; // this is the variable in the shader -/// \endcode -/// \code -/// sfShader_setFloat2Parameter(shader, "myparam", 5.2f, 6.0f); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param x First component of the value to assign -/// \param y Second component of the value to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y); - -//////////////////////////////////////////////////////////// -/// \brief Change a 3-components vector parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 3x1 vector -/// (vec3 GLSL type). -/// -/// Example: -/// \code -/// uniform vec3 myparam; // this is the variable in the shader -/// \endcode -/// \code -/// sfShader_setFloat3Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param x First component of the value to assign -/// \param y Second component of the value to assign -/// \param z Third component of the value to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z); - -//////////////////////////////////////////////////////////// -/// \brief Change a 4-components vector parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 4x1 vector -/// (vec4 GLSL type). -/// -/// Example: -/// \code -/// uniform vec4 myparam; // this is the variable in the shader -/// \endcode -/// \code -/// sfShader_setFloat4Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f, 0.4f); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param x First component of the value to assign -/// \param y Second component of the value to assign -/// \param z Third component of the value to assign -/// \param w Fourth component of the value to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w); - -//////////////////////////////////////////////////////////// -/// \brief Change a 2-components vector parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 2x1 vector -/// (vec2 GLSL type). -/// -/// Example: -/// \code -/// uniform vec2 myparam; // this is the variable in the shader -/// \endcode -/// \code -/// sfVector2f vec = {5.2f, 6.0f}; -/// sfShader_setVector2Parameter(shader, "myparam", vec); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param vector Vector to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector); - -//////////////////////////////////////////////////////////// -/// \brief Change a 3-components vector parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 3x1 vector -/// (vec3 GLSL type). -/// -/// Example: -/// \code -/// uniform vec3 myparam; // this is the variable in the shader -/// \endcode -/// \code -/// sfVector3f vec = {5.2f, 6.0f, -8.1f}; -/// sfShader_setVector3Parameter(shader, "myparam", vec); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param vector Vector to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector); - -//////////////////////////////////////////////////////////// -/// \brief Change a color parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 4x1 vector -/// (vec4 GLSL type). -/// -/// It is important to note that the components of the color are -/// normalized before being passed to the shader. Therefore, -/// they are converted from range [0 .. 255] to range [0 .. 1]. -/// For example, a sf::Color(255, 125, 0, 255) will be transformed -/// to a vec4(1.0, 0.5, 0.0, 1.0) in the shader. -/// -/// Example: -/// \code -/// uniform vec4 color; // this is the variable in the shader -/// \endcode -/// \code -/// sfShader_setColorParameter(shader, "color", sfColor_fromRGB(255, 128, 0)); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param color Color to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color); - -//////////////////////////////////////////////////////////// -/// \brief Change a matrix parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 4x4 matrix -/// (mat4 GLSL type). -/// -/// Example: -/// \code -/// uniform mat4 matrix; // this is the variable in the shader -/// \endcode -/// \code -/// @todo -/// sfShader_setTransformParameter(shader, "matrix", transform); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the parameter in the shader -/// \param transform Transform to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform); - -//////////////////////////////////////////////////////////// -/// \brief Change a texture parameter of a shader -/// -/// \a name is the name of the variable to change in the shader. -/// The corresponding parameter in the shader must be a 2D texture -/// (sampler2D GLSL type). -/// -/// Example: -/// \code -/// uniform sampler2D the_texture; // this is the variable in the shader -/// \endcode -/// \code -/// sf::Texture texture; -/// ... -/// sfShader_setTextureParameter(shader, "the_texture", texture); -/// \endcode -/// It is important to note that \a texture must remain alive as long -/// as the shader uses it, no copy is made internally. -/// -/// To use the texture of the object being draw, which cannot be -/// known in advance, you can use the special function -/// sfShader_setCurrentTextureParameter: -/// \code -/// sfShader_setCurrentTextureParameter(shader, "the_texture"). -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the texture in the shader -/// \param texture Texture to assign -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture); - -//////////////////////////////////////////////////////////// -/// \brief Change a texture parameter of a shader -/// -/// This function maps a shader texture variable to the -/// texture of the object being drawn, which cannot be -/// known in advance. -/// The corresponding parameter in the shader must be a 2D texture -/// (sampler2D GLSL type). -/// -/// Example: -/// \code -/// uniform sampler2D current; // this is the variable in the shader -/// \endcode -/// \code -/// sfShader_setCurrentTextureParameter(shader, "current"); -/// \endcode -/// -/// \param shader Shader object -/// \param name Name of the texture in the shader -/// -//////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name); - //////////////////////////////////////////////////////////// /// \brief Get the underlying OpenGL handle of the shader. /// diff --git a/include/SFML/Window/Event.h b/include/SFML/Window/Event.h index fa1f989..369de2d 100644 --- a/include/SFML/Window/Event.h +++ b/include/SFML/Window/Event.h @@ -48,7 +48,6 @@ typedef enum sfEvtTextEntered, ///< A character was entered (data in event.text) sfEvtKeyPressed, ///< A key was pressed (data in event.key) sfEvtKeyReleased, ///< A key was released (data in event.key) - sfEvtMouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel) (deprecated) sfEvtMouseWheelScrolled, ///< The mouse wheel was scrolled (data in event.mouseWheelScroll) sfEvtMouseButtonPressed, ///< A mouse button was pressed (data in event.mouseButton) sfEvtMouseButtonReleased, ///< A mouse button was released (data in event.mouseButton) @@ -117,21 +116,6 @@ typedef struct int y; } sfMouseButtonEvent; -//////////////////////////////////////////////////////////// -/// \brief Mouse wheel events parameters -/// -/// \deprecated -/// Use sfMouseWheelScrollEvent instead. -/// -//////////////////////////////////////////////////////////// -typedef struct CSFML_DEPRECATED -{ - sfEventType type; - int delta; - int x; - int y; -} sfMouseWheelEvent; - //////////////////////////////////////////////////////////// /// \brief Mouse wheel events parameters /// @@ -226,7 +210,6 @@ typedef union sfTextEvent text; ///< Text event parameters sfMouseMoveEvent mouseMove; ///< Mouse move event parameters sfMouseButtonEvent mouseButton; ///< Mouse button event parameters - sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (deprecated) sfMouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters diff --git a/src/SFML/ConvertEvent.h b/src/SFML/ConvertEvent.h index ef8bb24..6df4375 100644 --- a/src/SFML/ConvertEvent.h +++ b/src/SFML/ConvertEvent.h @@ -62,12 +62,6 @@ inline void convertEvent(const sf::Event& sfmlEvent, sfEvent* event) event->key.system = sfmlEvent.key.system; break; - case sfEvtMouseWheelMoved : - event->mouseWheel.delta = sfmlEvent.mouseWheel.delta; - event->mouseWheel.x = sfmlEvent.mouseWheel.x; - event->mouseWheel.y = sfmlEvent.mouseWheel.y; - break; - case sfEvtMouseWheelScrolled : event->mouseWheelScroll.wheel = static_cast(sfmlEvent.mouseWheelScroll.wheel); event->mouseWheelScroll.delta = sfmlEvent.mouseWheelScroll.delta; diff --git a/src/SFML/Graphics/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp index 2bfa1fa..bd651d2 100644 --- a/src/SFML/Graphics/RenderWindow.cpp +++ b/src/SFML/Graphics/RenderWindow.cpp @@ -526,18 +526,6 @@ void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow) } -//////////////////////////////////////////////////////////// -sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow) -{ - CSFML_CHECK_RETURN(renderWindow, nullptr); - - sfImage* image = new sfImage; - image->This = renderWindow->This.capture(); - - return image; -} - - //////////////////////////////////////////////////////////// sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo) { diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index 608faf2..144b36c 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -375,62 +375,6 @@ void sfShader_setMat4UniformArray(sfShader* shader, const char* name, const sfGl } -//////////////////////////////////////////////////////////// -void sfShader_setFloatParameter(sfShader* shader, const char* name, float x) -{ - CSFML_CALL(shader, setParameter(name, x)); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y) -{ - CSFML_CALL(shader, setParameter(name, x, y)); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z) -{ - CSFML_CALL(shader, setParameter(name, x, y, z)); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w) -{ - CSFML_CALL(shader, setParameter(name, x, y, z, w)); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector) -{ - CSFML_CALL(shader, setParameter(name, sf::Vector2f(vector.x, vector.y))); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector) -{ - CSFML_CALL(shader, setParameter(name, sf::Vector3f(vector.x, vector.y, vector.z))); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color) -{ - CSFML_CALL(shader, setParameter(name, sf::Color(color.r, color.g, color.b, color.a))); -} - - -//////////////////////////////////////////////////////////// -void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform) -{ - CSFML_CALL(shader, setParameter(name, convertTransform(transform))); -} - - //////////////////////////////////////////////////////////// void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture) { @@ -439,13 +383,6 @@ void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTe } -//////////////////////////////////////////////////////////// -void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name) -{ - CSFML_CALL(shader, setParameter(name, sf::Shader::CurrentTexture)); -} - - //////////////////////////////////////////////////////////// unsigned int sfShader_getNativeHandle(const sfShader* shader) {