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-2023 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 {
20namespace engine {
25class Window {
26 public:
27 virtual bool ButtonIsHeld(int btn) const = 0;
28 virtual bool ButtonIsReleased(int btn) const = 0;
29 virtual bool ButtonIsPressed(int btn) const = 0;
30 virtual double GetMouseX() const = 0;
31 virtual double GetMouseY() const = 0;
32
33 virtual bool MouseButtonIsHeld(int btn) const = 0;
34 virtual bool MouseButtonIsReleased(int btn) const = 0;
35 virtual bool MouseButtonIsPressed(int btn) const = 0;
36 virtual bool MouseDragged() const = 0;
37 virtual double MouseButtonLastReleased(int btn) const = 0;
38 virtual bool MouseButtonDoubleClicked(int btn) const = 0;
39
40 virtual int GetScrollAmount() const = 0;
41
42 virtual void SetWindowSize(int width, int height) = 0;
43 virtual int GetWindowHeight() const = 0;
44 virtual int GetWindowWidth() const = 0;
45
46 virtual void SetCallbacks() = 0;
47 virtual void Destroy() = 0;
48
52 virtual void OnFrame() = 0;
53
54 virtual void InitWindow(int width, int height) = 0;
55
56 virtual bool WindowSizeChanged() const = 0;
57
58 virtual float GetTime() const = 0;
59
60 virtual void SetFullScreen(bool fullscreen) const = 0;
61
62 virtual bool ShouldExit() const = 0;
63 virtual bool ExitApplication() = 0;
64
65 virtual void SetIcon(std::string_view path) = 0;
66};
67} // namespace engine
68} // namespace cqsp
The window handles the initialization of the callbacks, and all the input and output....
Definition: window.h:25
virtual void SetIcon(std::string_view path)=0
virtual void InitWindow(int width, int height)=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 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
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: clientctx.h:21