From 2d0c923a53490cbcde1c0a0e771e50c5ad402f44 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 5 Jan 2023 17:52:25 -0700 Subject: [PATCH] Prevent using a temporary `sf::Texture` with `sf::Shader` --- include/SFML/Graphics/Shader.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/SFML/Graphics/Shader.hpp b/include/SFML/Graphics/Shader.hpp index 9a944ffb..acfae025 100644 --- a/include/SFML/Graphics/Shader.hpp +++ b/include/SFML/Graphics/Shader.hpp @@ -496,6 +496,12 @@ public: //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Texture& texture); + //////////////////////////////////////////////////////////// + /// \brief Disallow setting from a temporary texture + /// + //////////////////////////////////////////////////////////// + void setUniform(const std::string& name, Texture&& texture) = delete; + //////////////////////////////////////////////////////////// /// \brief Specify current texture as \p sampler2D uniform ///