@@ -26,30 +26,59 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2626
2727namespace ruisapp {
2828
29+ /* *
30+ * @brief Widnow orientation policy.
31+ */
32+ enum class orientation {
33+ /* *
34+ * @brief Switch orientation when screen orientation changes.
35+ */
36+ dynamic,
37+
38+ /* *
39+ * @brief Stay always in landscape orientation.
40+ */
41+ landscape,
42+
43+ /* *
44+ * @brief Stay always in portrait orientation.
45+ */
46+ portrait
47+ };
48+
49+ /* *
50+ * @brief Graphics buffer kind.
51+ * Color buffer is always present, so no enum entry for color buffer is needed.
52+ */
53+ enum class buffer {
54+ depth,
55+ stencil,
56+
57+ enum_size
58+ };
59+
2960/* *
3061 * @brief Desired window parameters.
3162 */
3263struct window_params {
3364 /* *
3465 * @brief Desired dimensions of the window
3566 */
36- r4::vector2<unsigned > dims;
67+ r4::vector2<unsigned > dims = { 300 , 150 } ;
3768
3869 /* *
3970 * @brief Window title.
4071 */
4172 std::string title = " ruisapp" ;
4273
4374 /* *
44- * @brief Graphics buffer kind.
45- * Color buffer is always present, so no enum entry for color buffer is needed.
75+ * @brief Orientation policy.
4676 */
47- enum class buffer {
48- depth,
49- stencil,
77+ ruisapp::orientation orientation = ruisapp::orientation::dynamic;
5078
51- enum_size
52- };
79+ // TODO: remove
80+ // DEPRECATED: use ruisapp::buffer.
81+ using buffer = ruisapp::buffer;
5382
5483 /* *
5584 * @brief Flags describing desired buffers for rendering context.
@@ -64,10 +93,6 @@ struct window_params {
6493 .minor = 0
6594 };
6695 // clang-format on
67-
68- window_params (r4::vector2<unsigned > dims) :
69- dims (dims)
70- {}
7196};
7297
7398class window
0 commit comments