ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
载入中...
搜索中...
未找到
Game类 参考

引擎主控类 更多...

#include <Game.h>

Public 成员函数

 Game ()
 ~Game ()
bool init ()
 初始化引擎所有子系统
void run ()
 启动主循环(阻塞直至窗口关闭)
 Game (const Game &)=delete
Gameoperator= (const Game &)=delete
 Game (Game &&)=delete
Gameoperator= (Game &&)=delete

静态 Public 成员函数

static GameGetInstance ()
static bool Init ()
static void Run ()
static void Destroy ()
 反初始化,按依赖逆序清理子系统(init 部分失败时也能安全调用)
static bool IsRunning ()
 主循环是否仍在运行
static void SetPaused (bool paused)
 全局暂停(冻结 Behavior/物理,UI 叠层照常)
static bool IsPaused ()
 是否处于暂停状态

详细描述

引擎主控类

管理引擎的初始化、主循环与销毁。 所有静态方法内聚为单例调用。

使用方式: Game::Init(); Game::Run(); Game::Destroy();

构造及析构函数说明

◆ Game() [1/3]

Game ( )

◆ ~Game()

~Game ( )

◆ Game() [2/3]

Game ( const Game & )
delete

◆ Game() [3/3]

Game ( Game && )
delete

成员函数说明

◆ Destroy()

void Destroy ( )
inlinestatic

反初始化,按依赖逆序清理子系统(init 部分失败时也能安全调用)

◆ GetInstance()

Game & GetInstance ( )
static

◆ Init()

bool Init ( )
inlinestatic

◆ init()

bool init ( )

初始化引擎所有子系统

◆ IsPaused()

bool IsPaused ( )
inlinestatic

是否处于暂停状态

◆ IsRunning()

bool IsRunning ( )
inlinestatic

主循环是否仍在运行

◆ operator=() [1/2]

Game & operator= ( const Game & )
delete

◆ operator=() [2/2]

Game & operator= ( Game && )
delete

◆ Run()

void Run ( )
inlinestatic

◆ run()

void run ( )

启动主循环(阻塞直至窗口关闭)

◆ SetPaused()

void SetPaused ( bool paused)
inlinestatic

全局暂停(冻结 Behavior/物理,UI 叠层照常)


该类的文档由以下文件生成:
  • include/ShitEngine/Core/Game.h