Copperfield Engine 0.1
C++ Game Engine
Loading...
Searching...
No Matches
window.hpp
1#pragma once
2#include <string>
3#include <unordered_map>
4#include <vector>
5
6
7#include "ecs/component_manager.hpp"
9
10struct GLFWwindow;
11class Engine;
12class Triangle;
13
14enum class InputButton;
15using InputButtonMap =
16std::unordered_map<std::string, std::vector<InputButton>>;
17class InputManager;
18
20class Window {
21 friend class InputManager;
22 friend class Renderer;
23 friend class Editor;
24
25public:
26 ~Window();
28 Window(const Window&) = delete;
30 Window(Window&&) noexcept;
32 Window& operator=(const Window&) = delete;
35 Window& operator=(Window&&) noexcept;
36
43 static Window Make(Engine& engine, int width, int height,
44 const std::string& title);
45
48 bool isDone();
49
50private:
51 Window(GLFWwindow* w, Engine* e);
52
54 GLFWwindow* window_handle_;
55 std::unique_ptr<InputManager> engine_inputs_;
56 Engine* engine_;
57
58};
Display and allows to modify entity information in real time.
Definition: editor.hpp:14
Intiliazes the ComponentManager and the ResourceManager and ofers functions to retrieve them.
Definition: engine.hpp:12
Interface to retrieve keyboard and mouse input.
Definition: input.hpp:180
Class used to render the scene.
Definition: renderer.hpp:49
Creates and updates a window.
Definition: window.hpp:20
bool isDone()
Checks if the user wants to close the window and performs internal frame updates.
static Window Make(Engine &engine, int width, int height, const std::string &title)
Creates a window.
Window(Window &&) noexcept
Move constructor.
Window(const Window &)=delete
Copy constructor (deleted).
Defines all the components created by the engine by default.
std::unordered_map< std::string, std::vector< InputButton > > InputButtonMap
Structure that binds user-created actions and physical input.
Definition: input.hpp:175
InputButton
Allowed keyboard and mouse buttons.
Definition: input.hpp:23