diff options
author | James Cowgill <jcowgill@debian.org> | 2018-05-15 13:58:15 +0100 |
---|---|---|
committer | James Cowgill <jcowgill@debian.org> | 2018-05-15 13:58:15 +0100 |
commit | b175eed3ca950204c9b52fdcebc897f337b7bf19 (patch) | |
tree | 0f50d921750c957f11bda18abc83f9228d010902 /src/SFML/Graphics/RenderWindow.cpp | |
parent | 31394fcd65a10f2d2c51c3d27afff5367bded901 (diff) |
New upstream version 2.5.0+dfsg
Diffstat (limited to 'src/SFML/Graphics/RenderWindow.cpp')
-rw-r--r-- | src/SFML/Graphics/RenderWindow.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/SFML/Graphics/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp index 7ac7804..906363b 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-2017 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,8 @@ //////////////////////////////////////////////////////////// #include <SFML/Graphics/RenderWindow.hpp> #include <SFML/Graphics/Texture.hpp> +#include <SFML/Graphics/GLCheck.hpp> +#include <SFML/Graphics/RenderTextureImplFBO.hpp> namespace sf @@ -62,16 +64,31 @@ RenderWindow::~RenderWindow() //////////////////////////////////////////////////////////// -bool RenderWindow::activate(bool active) +Vector2u RenderWindow::getSize() const { - return setActive(active); + return Window::getSize(); } //////////////////////////////////////////////////////////// -Vector2u RenderWindow::getSize() const +bool RenderWindow::setActive(bool active) { - return Window::getSize(); + bool result = Window::setActive(active); + + // Update RenderTarget tracking + if (result) + RenderTarget::setActive(active); + + // If FBOs are available, make sure none are bound when we + // try to draw to the default framebuffer of the RenderWindow + if (result && priv::RenderTextureImplFBO::isAvailable()) + { + priv::RenderTextureImplFBO::unbind(); + + return true; + } + + return result; } |