fennec
Loading...
Searching...
No Matches
gfxcontext.h
Go to the documentation of this file.
1// =====================================================================================================================
2// fennec, a free and open source game engine
3// Copyright © 2025 Medusa Slockbower
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17// =====================================================================================================================
18
30
31#ifndef FENNEC_RENDERERS_INTERFACE_GFXCONTEXT_H
32#define FENNEC_RENDERERS_INTERFACE_GFXCONTEXT_H
33
34#include <fennec/platform/interface/fwd.h>
35
36#include <fennec/core/version.h>
37#include <fennec/lang/types.h>
38#include <fennec/string/string.h>
39
40#include <fennec/rtti/enable.h>
41
44
45namespace fennec
46{
47
48class gfxcontext {
49public:
50 enum texture_ : uint8_t {
51 texture_1d = 0,
52 texture_1d_array,
53 texture_2d,
54 texture_2d_array,
55 texture_multisample,
56 texture_multisample_array,
57 texture_cubemap,
58 texture_cubemap_array,
59 texture_3d,
60 };
61
62 using handle_t = uint32_t;
63
64 gfxresourcepool resources;
65
66 gfxcontext(display_server* display)
67 : display(display)
68 , version(0, 0, 0, string("")) {
69 }
70
71 virtual ~gfxcontext() = default;
72
73 gfxcontext& operator=(const gfxcontext&) = delete;
74 gfxcontext& operator=(gfxcontext&&) = delete;
75
76 virtual bool is_valid() = 0;
77
78 virtual gfxsurface* create_surface(window* window) = 0;
79
80 virtual gfxpass* create_pass() = 0;
81 virtual const version& get_version() const { return version; };
82
83protected:
84 display_server* display;
85 version version;
86
87 FENNEC_RTTI_CLASS_ENABLE() {
88 }
89};
90
91}
92
93#endif // FENNEC_RENDERERS_INTERFACE_GFXCONTEXT_H
Types
::uint32_t uint32_t
Unsigned 32-bit integer.
Definition types.h:274
::uint8_t uint8_t
Unsigned 8-bit integer.
Definition types.h:272