Files
XCEngine/docs/api/resources/texture/getwidth.md

485 B

Texture::GetWidth

Core::uint32 GetWidth() const

获取纹理宽度。

参数:

返回: 纹理宽度(像素)

线程安全:

示例:

Texture tex;
tex.Create(1024, 512, 1, 1, 
    TextureType::Texture2D, 
    TextureFormat::RGBA8_UNORM, 
    nullptr, 0);

Core::uint32 width = tex.GetWidth(); // 返回 1024

相关文档