diff --git a/src/SFML/Graphics/RenderTextureImplDefault.cpp b/src/SFML/Graphics/RenderTextureImplDefault.cpp index 1585cb41b..253326e26 100644 --- a/src/SFML/Graphics/RenderTextureImplDefault.cpp +++ b/src/SFML/Graphics/RenderTextureImplDefault.cpp @@ -42,10 +42,6 @@ namespace sf::priv RenderTextureImplDefault::RenderTextureImplDefault() = default; -//////////////////////////////////////////////////////////// -RenderTextureImplDefault::~RenderTextureImplDefault() = default; - - //////////////////////////////////////////////////////////// unsigned int RenderTextureImplDefault::getMaximumAntiAliasingLevel() { @@ -63,7 +59,7 @@ bool RenderTextureImplDefault::create(Vector2u size, unsigned int, const Context m_size = size; // Create the in-memory OpenGL context - m_context = std::make_unique(settings, size); + m_context = {settings, size}; return true; } @@ -72,14 +68,14 @@ bool RenderTextureImplDefault::create(Vector2u size, unsigned int, const Context //////////////////////////////////////////////////////////// bool RenderTextureImplDefault::activate(bool active) { - return m_context->setActive(active); + return m_context.setActive(active); } //////////////////////////////////////////////////////////// bool RenderTextureImplDefault::isSrgb() const { - return m_context->getSettings().sRgbCapable; + return m_context.getSettings().sRgbCapable; } diff --git a/src/SFML/Graphics/RenderTextureImplDefault.hpp b/src/SFML/Graphics/RenderTextureImplDefault.hpp index bcf561c76..9eb9ae8a9 100644 --- a/src/SFML/Graphics/RenderTextureImplDefault.hpp +++ b/src/SFML/Graphics/RenderTextureImplDefault.hpp @@ -29,19 +29,11 @@ //////////////////////////////////////////////////////////// #include +#include #include -#include -#include - - -namespace sf -{ -class Context; -struct ContextSettings; - -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Default specialization of RenderTextureImpl, @@ -57,12 +49,6 @@ public: //////////////////////////////////////////////////////////// RenderTextureImplDefault(); - //////////////////////////////////////////////////////////// - /// \brief Destructor - /// - //////////////////////////////////////////////////////////// - ~RenderTextureImplDefault() override; - //////////////////////////////////////////////////////////// /// \brief Get the maximum anti-aliasing level supported by the system /// @@ -116,10 +102,8 @@ private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - std::unique_ptr m_context; //!< P-Buffer based context - Vector2u m_size; //!< Width and height of the P-Buffer + Context m_context; //!< P-Buffer based context + Vector2u m_size; //!< Width and height of the P-Buffer }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv