]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/videomode.h
c527ed75de9d75b2d42b45a8635f87ee7c854be9
[libs/gui.git] / source / graphics / videomode.h
1 #ifndef MSP_GRAPHICS_VIDEOMODE_H_
2 #define MSP_GRAPHICS_VIDEOMODE_H_
3
4 #include <stdexcept>
5
6 namespace Msp {
7 namespace Graphics {
8
9 struct Monitor;
10 struct VideoMode;
11
12 class unsupported_video_mode: public std::runtime_error
13 {
14 public:
15         unsupported_video_mode(const VideoMode &);
16 };
17
18
19 enum VideoRotation
20 {
21         ROTATE_ANY,
22         ROTATE_NORMAL,
23         ROTATE_LEFT,
24         ROTATE_RIGHT,
25         ROTATE_INVERTED
26 };
27
28 struct VideoMode
29 {
30         unsigned index = 0;
31         const Monitor *monitor = nullptr;
32         unsigned width = 0;
33         unsigned height = 0;
34         float rate = 0.0f;
35         VideoRotation rotation = ROTATE_ANY;
36
37         VideoMode() = default;
38         VideoMode(unsigned, unsigned);
39 };
40
41 } // namespace Graphics
42 } // namespace Msp
43
44 #endif