This repository was archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrenderer.hpp
More file actions
66 lines (49 loc) · 1.35 KB
/
Copy pathrenderer.hpp
File metadata and controls
66 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
/**
* Copyright (C) 2020 Tristan. All Rights Reserved.
* This file is licensed under the BSD 2-Clause license.
* See the COPYING file for licensing information.
*/
#include <memory>
namespace Rendering {
enum class RendererType { OPENGL };
class Renderer;
} // namespace Rendering
#include "window/window.hpp"
#include "rendering/input.hpp"
namespace Rendering {
class Renderer {
private: // Properties
const RendererType rendererType;
std::shared_ptr<Rendering::WindowBase> internalWindow{ nullptr };
protected:
inline explicit Renderer(RendererType type) : rendererType(type) {
}
[[nodiscard]] inline std::shared_ptr<Rendering::WindowBase>
window() const noexcept {
return internalWindow;
}
public: // Methods
virtual ~Renderer() = default;
/* The name may be misleading, but this function will be called every
* 'loop' and this function should calculate which or if it should (re)
* draw some parts of the queue. */
virtual void
DrawFrame()
= 0;
virtual void
Prepare()
= 0;
virtual void
OnMouseDown(MouseButton, double x, double y)
= 0;
virtual inline void
SetWindow(const std::shared_ptr<Rendering::WindowBase> &window) noexcept {
internalWindow = window;
}
[[nodiscard]] inline RendererType
type() const noexcept {
return rendererType;
}
};
} // namespace Rendering