-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindow.cpp
More file actions
32 lines (25 loc) · 693 Bytes
/
Window.cpp
File metadata and controls
32 lines (25 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Window.hpp"
#include "RectangleFunctions.hpp"
namespace TappyPlane {
constexpr auto title = "Tappy Plane";
constexpr SDLW::Video::Size aspectRatio{9, 16};
constexpr double debugScale{0.9};
static SDLW::Video::Size size()
{
auto resultSize = aspectRatio;
scaleToFit(resultSize, SDLW::Video::Display::usableBounds(0).size());
scale(resultSize, debugScale);
return resultSize;
}
Window& Window::instance()
{
static Window window;
return window;
}
Window::Window()
: SDLW::Video::Window(::TappyPlane::title,
{SDLW::Video::Window::positionCentered, ::TappyPlane::size()},
SDLW::Video::Window::Flags::Shown)
{
}
} // namespace TappyPlane