ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
Toggle main menu visibility
载入中...
搜索中...
未找到
Game.h
浏览该文件的文档.
1
#pragma once
2
#include "
Core.h
"
3
4
namespace
Shit
{
16
class
SHIT_API
Game
{
17
public
:
18
Game
();
19
~Game
();
20
21
bool
init
();
22
void
run
();
23
24
// --- 静态API ---
25
static
Game
&
GetInstance
();
26
inline
static
bool
Init
() {
return
GetInstance
().init(); }
27
inline
static
void
Run
() {
GetInstance
().run(); }
28
static
void
Destroy
();
29
static
bool
IsRunning
() {
return
GetInstance
().m_isRunning; }
30
31
Game
(
const
Game
&) =
delete
;
32
Game
&
operator=
(
const
Game
&) =
delete
;
33
Game
(
Game
&&) =
delete
;
34
Game
&
operator=
(
Game
&&) =
delete
;
35
36
private
:
37
bool
m_isRunning =
false
;
38
bool
m_isInited =
false
;
39
};
40
}
Core.h
SHIT_API
#define SHIT_API
定义
Core.h:12
Shit::Game::operator=
Game & operator=(Game &&)=delete
Shit::Game::run
void run()
启动主循环(阻塞直至窗口关闭)
Shit::Game::operator=
Game & operator=(const Game &)=delete
Shit::Game::Game
Game(const Game &)=delete
Shit::Game::Destroy
static void Destroy()
反初始化,按依赖逆序清理子系统
Shit::Game::Game
Game()
Shit::Game::IsRunning
static bool IsRunning()
主循环是否仍在运行
定义
Game.h:29
Shit::Game::Run
static void Run()
定义
Game.h:27
Shit::Game::GetInstance
static Game & GetInstance()
Shit::Game::~Game
~Game()
Shit::Game::Init
static bool Init()
定义
Game.h:26
Shit::Game::init
bool init()
初始化引擎所有子系统
Shit::Game::Game
Game(Game &&)=delete
Shit
定义
AudioPlayer.h:9
ShitEngine
Core
Game.h
制作者
1.17.0