ScummVM API documentation
gfx_defines.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef AGS_ENGINE_GFX_GFX_DEFINES_H
23 #define AGS_ENGINE_GFX_GFX_DEFINES_H
24 
25 #include "ags/shared/core/types.h"
26 #include "ags/shared/util/geometry.h"
27 
28 namespace AGS3 {
29 namespace AGS {
30 namespace Engine {
31 
32 // GraphicResolution struct determines image size and color depth
34  int32_t ColorDepth; // color depth in bits per pixel
35 
37  : ColorDepth(0) {
38  }
39 
40  GraphicResolution(int32_t width, int32_t height, int32_t color_depth)
41  : Size(width, height), ColorDepth(color_depth) {
42  }
43 
44  GraphicResolution(Size size, int32_t color_depth)
45  : Size(size), ColorDepth(color_depth) {
46  }
47 
48  inline bool IsValid() const {
49  return Width > 0 && Height > 0 && ColorDepth > 0;
50  }
51 };
52 
53 enum WindowMode {
54  kWnd_Windowed, // regular resizable window with a border and a caption
55  kWnd_Fullscreen, // real (aka exclusive) fullscreen mode
56  kWnd_FullDesktop // borderless window filling whole desktop
57 };
58 
59 // DisplayMode struct provides extended description of display mode
60 struct DisplayMode : public GraphicResolution {
61  int32_t RefreshRate = 0;
62  bool Vsync = false;
63  WindowMode Mode = kWnd_Windowed;
64 
65  // Tells if this is logically a normal windowed mode
66  inline bool IsWindowed() const {
67  return Mode == kWnd_Windowed;
68  }
69  // Tells if this mode defines a real fullscreen, which would require gfx driver to support it
70  inline bool IsRealFullscreen() const {
71  return Mode == kWnd_Fullscreen;
72  }
73 
74  DisplayMode() = default;
75  DisplayMode(const GraphicResolution & res, WindowMode mode = kWnd_Windowed, int32_t refresh = 0, bool vsync = false)
76  : GraphicResolution(res)
77  , RefreshRate(refresh)
78  , Vsync(vsync)
79  , Mode(mode) {
80  }
81 };
82 
83 } // namespace Engine
84 } // namespace AGS
85 } // namespace AGS3
86 
87 #endif
Definition: achievements_tables.h:27
Definition: gfx_defines.h:60
Definition: geometry.h:144
Definition: gfx_defines.h:33
Definition: engine.h:143
Definition: ags.h:40