neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_display.hpp
Go to the documentation of this file.
1// i_display.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
25#include <neogfx/core/units.hpp>
26#include <neogfx/gfx/color.hpp>
29
30namespace neogfx
31{
32 enum class subpixel_format : uint32_t
33 {
34 None,
39 };
40}
41
49
50namespace neogfx
51{
52 class i_display : public i_units_context
53 {
54 public:
55 struct failed_to_get_monitor_dpi : std::runtime_error { failed_to_get_monitor_dpi() : std::runtime_error("neogfx::i_display::failed_to_get_monitor_dpi") {} };
56 struct fullscreen_not_active : std::logic_error { fullscreen_not_active() : std::logic_error("neogfx::i_display::fullscreen_not_active: Fullscreen not currently active") {} };
57 struct failed_to_enter_fullscreen : std::runtime_error { failed_to_enter_fullscreen(std::string const& aReason) :
58 std::runtime_error("neogfx::i_displayy::failed_to_enter_fullscreen: Failed to enter fullscreen, reason: " + aReason) {} };
59 struct failed_to_leave_fullscreen : std::runtime_error { failed_to_leave_fullscreen(std::string const& aReason) :
60 std::runtime_error("neogfx::i_displayy::failed_to_leave_fullscreen: Failed to leave fullscreen, reason: " + aReason) {} };
61 public:
62 virtual ~i_display() = default;
63 public:
64 virtual uint32_t index() const = 0;
65 public:
66 virtual const i_device_metrics& metrics() const = 0;
67 virtual void update_dpi() = 0;
68 public:
69 virtual bool is_fullscreen() const = 0;
70 virtual const video_mode& fullscreen_video_mode() const = 0;
71 virtual void enter_fullscreen(const video_mode& aVideoMode) = 0;
72 virtual void leave_fullscreen() = 0;
73 virtual neogfx::rect rect() const = 0;
74 virtual neogfx::rect desktop_rect() const = 0;
75 virtual window_placement default_window_placement() const = 0;
76 virtual neogfx::color_space color_space() const = 0;
77 virtual color read_pixel(const point& aPosition) const = 0;
78 public:
79 virtual neogfx::subpixel_format subpixel_format() const = 0;
80 };
81}
#define end_declare_enum(enumName)
Definition i_enum.hpp:62
#define declare_enum_string(enumName, enumEnumerator)
Definition i_enum.hpp:59
#define begin_declare_enum(enumName)
Definition i_enum.hpp:52
gui_rect rect
sRGB_color color
Definition color.hpp:1067
subpixel_format
Definition i_display.hpp:33
Definition plf_hive.h:79