mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 02:45:57 -04:00
parent
a53df08ff8
commit
f3bc4abd17
@ -2,6 +2,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## 0.16.0 - unreleased
|
||||||
|
### Added
|
||||||
|
* New SDL 2.0.5 ```Window``` method: ```Window::SetResizable()```
|
||||||
|
|
||||||
## 0.15.0 - 2017-07-10
|
## 0.15.0 - 2017-07-10
|
||||||
### Added
|
### Added
|
||||||
* ```Color``` class wrapping around ```SDL_Color```
|
* ```Color``` class wrapping around ```SDL_Color```
|
||||||
|
@ -259,6 +259,11 @@ float Window::GetOpacity() const {
|
|||||||
|
|
||||||
return opacity;
|
return opacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Window& Window::SetResizable(bool resizable) {
|
||||||
|
SDL_SetWindowResizable(window_, resizable ? SDL_TRUE : SDL_FALSE);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -558,6 +558,18 @@ public:
|
|||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
float GetOpacity() const;
|
float GetOpacity() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set user-resizable state of a window
|
||||||
|
///
|
||||||
|
/// \param[in] resizable True to allow resizing, false to disallow
|
||||||
|
///
|
||||||
|
/// \returns Reference to self
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_SetWindowResizable
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window& SetResizable(bool resizable = true);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -212,6 +212,29 @@ BEGIN_TEST(int, char*[])
|
|||||||
EventSleep(1000);
|
EventSleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Resizable
|
||||||
|
Uint32 flags = window.GetFlags();
|
||||||
|
|
||||||
|
if (flags & SDL_WINDOW_RESIZABLE) {
|
||||||
|
window.SetResizable(false);
|
||||||
|
EXPECT_TRUE(!(window.GetFlags() & SDL_WINDOW_RESIZABLE));
|
||||||
|
EventSleep(1000);
|
||||||
|
|
||||||
|
window.SetResizable(true);
|
||||||
|
EXPECT_TRUE(window.GetFlags() & SDL_WINDOW_RESIZABLE);
|
||||||
|
EventSleep(1000);
|
||||||
|
} else {
|
||||||
|
window.SetResizable(true);
|
||||||
|
EXPECT_TRUE(window.GetFlags() & SDL_WINDOW_RESIZABLE);
|
||||||
|
EventSleep(1000);
|
||||||
|
|
||||||
|
window.SetResizable(false);
|
||||||
|
EXPECT_TRUE(!(window.GetFlags() & SDL_WINDOW_RESIZABLE));
|
||||||
|
EventSleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
END_TEST()
|
END_TEST()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user