mirror of
https://github.com/SFML/SFML.git
synced 2025-02-18 06:18:01 +08:00
Enable moving windows
This commit is contained in:
parent
7556d1be78
commit
fbd8407a5f
@ -134,6 +134,30 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
~Window() override;
|
~Window() override;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Deleted copy constructor
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window(const Window&) = delete;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Deleted copy assignment
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window& operator=(const Window&) = delete;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Move constructor
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window(Window&&) noexcept;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Move assignment
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window& operator=(Window&&) noexcept;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create (or recreate) the window
|
/// \brief Create (or recreate) the window
|
||||||
///
|
///
|
||||||
|
@ -130,6 +130,18 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
WindowBase& operator=(const WindowBase&) = delete;
|
WindowBase& operator=(const WindowBase&) = delete;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Move constructor
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
WindowBase(WindowBase&&) noexcept;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Move assignment
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
WindowBase& operator=(WindowBase&&) noexcept;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create (or recreate) the window
|
/// \brief Create (or recreate) the window
|
||||||
///
|
///
|
||||||
|
@ -66,6 +66,14 @@ Window::Window(WindowHandle handle, const ContextSettings& settings)
|
|||||||
Window::~Window() = default;
|
Window::~Window() = default;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window::Window(Window&&) noexcept = default;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window& Window::operator=(Window&&) noexcept = default;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void Window::create(VideoMode mode, const String& title, std::uint32_t style, State state)
|
void Window::create(VideoMode mode, const String& title, std::uint32_t style, State state)
|
||||||
{
|
{
|
||||||
|
@ -77,6 +77,14 @@ WindowBase::WindowBase(WindowHandle handle)
|
|||||||
WindowBase::~WindowBase() = default;
|
WindowBase::~WindowBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
WindowBase::WindowBase(WindowBase&&) noexcept = default;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
WindowBase& WindowBase::operator=(WindowBase&&) noexcept = default;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void WindowBase::create(VideoMode mode, const String& title, std::uint32_t style, State state)
|
void WindowBase::create(VideoMode mode, const String& title, std::uint32_t style, State state)
|
||||||
{
|
{
|
||||||
|
@ -21,8 +21,8 @@ TEST_CASE("[Graphics] sf::RenderWindow", runDisplayTests())
|
|||||||
STATIC_CHECK(std::has_virtual_destructor_v<sf::RenderWindow>);
|
STATIC_CHECK(std::has_virtual_destructor_v<sf::RenderWindow>);
|
||||||
STATIC_CHECK(!std::is_copy_constructible_v<sf::RenderWindow>);
|
STATIC_CHECK(!std::is_copy_constructible_v<sf::RenderWindow>);
|
||||||
STATIC_CHECK(!std::is_copy_assignable_v<sf::RenderWindow>);
|
STATIC_CHECK(!std::is_copy_assignable_v<sf::RenderWindow>);
|
||||||
STATIC_CHECK(!std::is_nothrow_move_constructible_v<sf::RenderWindow>);
|
STATIC_CHECK(std::is_nothrow_move_constructible_v<sf::RenderWindow>);
|
||||||
STATIC_CHECK(!std::is_nothrow_move_assignable_v<sf::RenderWindow>);
|
STATIC_CHECK(std::is_nothrow_move_assignable_v<sf::RenderWindow>);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Construction")
|
SECTION("Construction")
|
||||||
|
@ -14,10 +14,11 @@ TEST_CASE("[Window] sf::Window", runDisplayTests())
|
|||||||
{
|
{
|
||||||
SECTION("Type traits")
|
SECTION("Type traits")
|
||||||
{
|
{
|
||||||
|
STATIC_CHECK(std::has_virtual_destructor_v<sf::Window>);
|
||||||
STATIC_CHECK(!std::is_copy_constructible_v<sf::Window>);
|
STATIC_CHECK(!std::is_copy_constructible_v<sf::Window>);
|
||||||
STATIC_CHECK(!std::is_copy_assignable_v<sf::Window>);
|
STATIC_CHECK(!std::is_copy_assignable_v<sf::Window>);
|
||||||
STATIC_CHECK(!std::is_nothrow_move_constructible_v<sf::Window>);
|
STATIC_CHECK(std::is_nothrow_move_constructible_v<sf::Window>);
|
||||||
STATIC_CHECK(!std::is_nothrow_move_assignable_v<sf::Window>);
|
STATIC_CHECK(std::is_nothrow_move_assignable_v<sf::Window>);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Construction")
|
SECTION("Construction")
|
||||||
|
@ -16,10 +16,11 @@ TEST_CASE("[Window] sf::WindowBase", runDisplayTests())
|
|||||||
{
|
{
|
||||||
SECTION("Type traits")
|
SECTION("Type traits")
|
||||||
{
|
{
|
||||||
|
STATIC_CHECK(std::has_virtual_destructor_v<sf::WindowBase>);
|
||||||
STATIC_CHECK(!std::is_copy_constructible_v<sf::WindowBase>);
|
STATIC_CHECK(!std::is_copy_constructible_v<sf::WindowBase>);
|
||||||
STATIC_CHECK(!std::is_copy_assignable_v<sf::WindowBase>);
|
STATIC_CHECK(!std::is_copy_assignable_v<sf::WindowBase>);
|
||||||
STATIC_CHECK(!std::is_nothrow_move_constructible_v<sf::WindowBase>);
|
STATIC_CHECK(std::is_nothrow_move_constructible_v<sf::WindowBase>);
|
||||||
STATIC_CHECK(!std::is_nothrow_move_assignable_v<sf::WindowBase>);
|
STATIC_CHECK(std::is_nothrow_move_assignable_v<sf::WindowBase>);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Construction")
|
SECTION("Construction")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user