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

纹理:封装 SDL_Texture*(渲染用;加载需渲染器已初始化) 更多...

#include <Resource.h>

类 Texture 继承关系图:
Resource

Public 成员函数

 Texture (std::string path)
 ~Texture () override
bool load () override
 加载底层句柄(子类实现;失败记录 m_error 并返回 false,内部已打日志)
void release () override
 释放底层句柄(幂等;子类析构与管理器回收时调用;基类无句柄可释放)
SDL_Texture * get () const
 借用句柄(空 = 未加载/失败)
Public 成员函数 继承自 Resource
 Resource (std::string path)
virtual ~Resource ()=default
 Resource (const Resource &)=delete
Resource & operator= (const Resource &)=delete
const std::string & getPath () const
ResourceState getState () const
bool isLoaded () const
const std::string & getError () const
 Failed 时的诊断信息
std::uint64_t getUuid () const
 会话级 uuid(进程内随机,不落盘)

额外继承的成员函数

Protected 属性 继承自 Resource
std::string m_path
std::string m_error
ResourceState m_state = ResourceState::Unloaded

详细描述

纹理:封装 SDL_Texture*(渲染用;加载需渲染器已初始化)

构造及析构函数说明

◆ Texture()

Texture ( std::string path)
inlineexplicit

◆ ~Texture()

~Texture ( )
inlineoverride

成员函数说明

◆ get()

SDL_Texture * get ( ) const
inline

借用句柄(空 = 未加载/失败)

◆ load()

bool load ( )
overridevirtual

加载底层句柄(子类实现;失败记录 m_error 并返回 false,内部已打日志)

实现了 Resource.

◆ release()

void release ( )
overridevirtual

释放底层句柄(幂等;子类析构与管理器回收时调用;基类无句柄可释放)

重载 Resource .


该类的文档由以下文件生成: