Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
window.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19namespace cqsp::engine {
24class Window {
25 public:
26 virtual bool ButtonIsHeld(int btn) const = 0;
27 virtual bool ButtonIsReleased(int btn) const = 0;
28 virtual bool ButtonIsPressed(int btn) const = 0;
29 virtual double GetMouseX() const = 0;
30 virtual double GetMouseY() const = 0;
31
32 virtual bool MouseButtonIsHeld(int btn) const = 0;
33 virtual bool MouseButtonIsReleased(int btn) const = 0;
34 virtual bool MouseButtonIsPressed(int btn) const = 0;
35 virtual bool MouseDragged() const = 0;
36 virtual double MouseButtonLastReleased(int btn) const = 0;
37 virtual bool MouseButtonDoubleClicked(int btn) const = 0;
38
39 virtual int GetScrollAmount() const = 0;
40
41 virtual void SetWindowSize(int width, int height) = 0;
42 virtual int GetWindowHeight() const = 0;
43 virtual int GetWindowWidth() const = 0;
44
45 virtual void SetCallbacks() = 0;
46 virtual void Destroy() = 0;
47
51 virtual void OnFrame() = 0;
52
53 virtual bool InitWindow(int width, int height) = 0;
54
55 virtual bool WindowSizeChanged() const = 0;
56
57 virtual float GetTime() const = 0;
58
59 virtual void SetFullScreen(bool fullscreen) const = 0;
60
61 virtual bool ShouldExit() const = 0;
62 virtual bool ExitApplication() = 0;
63
64 virtual void SetIcon(std::string_view path) = 0;
65};
66} // namespace cqsp::engine
The window handles the initialization of the callbacks, and all the input and output....
Definition: window.h:24
virtual void SetIcon(std::string_view path)=0
virtual void SetWindowSize(int width, int height)=0
virtual int GetWindowHeight() const =0
virtual bool MouseButtonIsHeld(int btn) const =0
virtual void Destroy()=0
virtual bool ButtonIsPressed(int btn) const =0
virtual bool WindowSizeChanged() const =0
virtual double MouseButtonLastReleased(int btn) const =0
virtual float GetTime() const =0
virtual bool InitWindow(int width, int height)=0
virtual bool MouseDragged() const =0
virtual int GetScrollAmount() const =0
virtual void OnFrame()=0
Any cleanups or clearing the window has to do each frame
virtual bool MouseButtonDoubleClicked(int btn) const =0
virtual double GetMouseX() const =0
virtual bool ButtonIsReleased(int btn) const =0
virtual void SetCallbacks()=0
virtual bool ButtonIsHeld(int btn) const =0
virtual double GetMouseY() const =0
virtual bool MouseButtonIsPressed(int btn) const =0
virtual void SetFullScreen(bool fullscreen) const =0
virtual bool ExitApplication()=0
virtual bool MouseButtonIsReleased(int btn) const =0
virtual int GetWindowWidth() const =0
virtual bool ShouldExit() const =0
Definition: application.cpp:55