fennec
Loading...
Searching...
No Matches
system.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
19#ifndef FENNEC_CORE_SYSTEM_H
20#define FENNEC_CORE_SYSTEM_H
21#include <fennec/string/string.h>
22
23namespace fennec
24{
25
26class system {
27public:
28 using tick_f = void (*)(system*, double);
29 using frame_f = void (*)(system*, size_t);
30
31 const string name;
32 const tick_f tick;
33 const frame_f frame;
34
35 system(const cstring& name, tick_f tick, frame_f frame)
36 : name(name), tick(tick), frame(frame) {
37 }
38
39 virtual ~system() = default;
40
41 virtual void init() = 0;
42 virtual void shutdown() = 0;
43};
44
45}
46
47#endif // FENNEC_CORE_SYSTEM_H
size_t size_t
Unsigned Integer Type Returned By sizeof, sizeof..., and alignof
Definition types.h:250