fennec
Loading...
Searching...
No Matches
gfxsurface.h
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
32#ifndef FENNEC_RENDERERS_INTERFACE_GFXSURFACE_H
33#define FENNEC_RENDERERS_INTERFACE_GFXSURFACE_H
34
36
37namespace fennec
38{
39
40class gfxsurface {
41public:
42 virtual ~gfxsurface() = default;
43
44 gfxsurface(window* win, gfxcontext* ctx)
45 : window(win), context(ctx) {
46 }
47
48 virtual void make_current() = 0;
49 virtual void swap() = 0;
50
51 virtual void resize(const ivec2& size) = 0;
52
53protected:
54 window* window;
55 gfxcontext* context;
56};
57
58}
59
60#endif // FENNEC_RENDERERS_INTERFACE_GFXSURFACE_H
constexpr void swap(T &x, T &y) noexcept
Swaps x and y.
Definition utility.h:114