Class Info |
|---|
class Texture 纹理类,包括纹理的创建、更新等操作。 |
Constructor Name |
|---|
Texture() 默认构造函数。 |
Texture(const GraphicsRenderer* graphicsRenderer) 构造函数,传入GraphicsRenderer指针。 |
Qualifier and Type | Method Name and Description |
|---|---|
bool | Create(const TextureCreateInfo& textureInfo) 根据TextureCreateInfo信息创建纹理。 |
inline const TextureCreateInfo& | GetTextureCreateInfo() const 获取TextureCreateInfo信息。 |
void | SetSampler(const Sampler* sampler) 设置该纹理的采样器。 |
inline const Sampler* | GetSampler() const 获取该纹理的采样器。 |
virtual bool | Update(const u8* data, u32 dataSize) = 0 更新该纹理上的纹理数据。 |
virtual bool | Update(const u8* const* buffers, const TextureUpdateRegion* regions, u32 count) = 0 更新该纹理上指定区域的纹理数据。 |
virtual void | 更改纹理的宽高重建纹理。 |
virtual bool | Resume() = 0 应用程序从后台切到前台时,完成纹理的创建。 |
virtual void | Pause() = 0 应用程序从前台切到后台时,完成纹理的销毁。 |
bool | Create(const TextureViewCreateInfo& textureViewInfo) 根据TextureViewCreateInfo信息创建纹理。 |
inline const TextureViewCreateInfo& | GetTextureViewCreateInfo() const |
Constructor |
|---|
Texture(const GraphicsRenderer* graphicsRenderer) 构造函数,传入GraphicsRenderer指针。 |
Parameters
Name | Description |
|---|---|
graphicsRenderer | 管理该纹理的GraphicsRenderer。 |
Method |
|---|
bool Create(const TextureCreateInfo& textureInfo) 根据TextureCreateInfo信息创建纹理。 |
Parameters
Name | Description |
|---|---|
textureInfo |
Returns
Type | Description |
|---|---|
bool | 返回创建结果。
|
Method |
|---|
inline const TextureCreateInfo& GetTextureCreateInfo() const 获取纹理的TextureCreateInfo信息。 |
Returns
Type | Description |
|---|---|
返回纹理的TextureCreateInfo信息。 |
Method |
|---|
bool Create(const TextureViewCreateInfo& textureViewInfo) 根据TextureViewCreateInfo信息创建纹理。 |
Parameters
Name | Description |
|---|---|
textureViewInfo |
Returns
Type | Description |
|---|---|
bool | 返回创建结果。
|
Method |
|---|
inline const TextureViewCreateInfo& GetTextureViewCreateInfo() const 获取纹理的TextureViewCreateInfo信息。 |
Returns
Type | Description |
|---|---|
返回纹理的TextureViewCreateInfo信息。 |
Method |
|---|
void SetSampler(const Sampler* sampler) 设置纹理的采样器。 |
Parameters
Name | Description |
|---|---|
sampler | 采样该纹理的采样器。 |
Method |
|---|
inline const Sampler* GetSampler() const 获取该纹理的采样器。 |
Returns
Type | Description |
|---|---|
该纹理的采样器。 |
Parameters
Name | Description |
|---|---|
data | 更新的纹理数据。 |
dataSize | 更新的纹理数据的大小。 |
Returns
Type | Description |
|---|---|
bool | 返回更新结果。
|
Method |
|---|
virtual bool Update(const u8* const* buffers, const TextureUpdateRegion* regions, u32 count) = 0 更新该纹理上指定区域的纹理数据。 |
Parameters
Name | Description |
|---|---|
buffers | 更新的纹理数据。 |
regions | 要更新纹理的区域。 |
count | 要更新纹理的区域数目。 |
Returns
Type | Description |
|---|---|
bool | 返回更新结果。
|