Antkeeper  0.0.1
window-manager.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Christopher J. Howard
3  *
4  * This file is part of Antkeeper source code.
5  *
6  * Antkeeper source code 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  * Antkeeper source code 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 Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef ANTKEEPER_APP_WINDOW_MANAGER_HPP
21 #define ANTKEEPER_APP_WINDOW_MANAGER_HPP
22 
23 #include <engine/app/display.hpp>
24 #include <engine/app/window.hpp>
25 #include <engine/math/vector.hpp>
26 #include <memory>
27 #include <string>
28 
29 namespace app {
30 
35 {
36 public:
40  static std::unique_ptr<window_manager> instance();
41 
43  virtual ~window_manager() = default;
44 
48  virtual void update() = 0;
49 
60  [[nodiscard]] virtual std::shared_ptr<window> create_window
61  (
62  const std::string& title,
63  const math::ivec2& windowed_position,
64  const math::ivec2& windowed_size,
65  bool maximized,
66  bool fullscreen,
67  bool v_sync
68  ) = 0;
69 
71  [[nodiscard]] virtual std::size_t get_display_count() const = 0;
72 
80  [[nodiscard]] virtual const display& get_display(std::size_t index) const = 0;
81 };
82 
83 } // namespace app
84 
85 #endif // ANTKEEPER_APP_WINDOW_MANAGER_HPP
Virtual display.
Definition: display.hpp:35
virtual ~window_manager()=default
Destructs a window manager.
virtual std::shared_ptr< window > create_window(const std::string &title, const math::ivec2 &windowed_position, const math::ivec2 &windowed_size, bool maximized, bool fullscreen, bool v_sync)=0
Constructs a window.
virtual std::size_t get_display_count() const =0
Returns the number of available displays.
virtual const display & get_display(std::size_t index) const =0
Returns the display with the given index.
virtual void update()=0
Updates all managed windows.
static std::unique_ptr< window_manager > instance()
Allocates and returns a window manager.
n-dimensional vector.
Definition: vector.hpp:44