vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::TextureAsset Struct Reference

Texture asset combining Resource tracking with engine-level texture parameters. More...

#include <texture_asset.h>

Inheritance diagram for Vkm::Engine::TextureAsset:
Vkm::Engine::Resource

Public Member Functions

bool isSrgb () const
 Whether the texture stores colour in sRGB.
TextureUsage usage () const
 What the texels mean, read off the internal format as isSrgb is.
Public Member Functions inherited from Vkm::Engine::Resource
 Resource (const Resource &other)
 Duplicate other's contents and name, but not its identity.
const std::string & name () const noexcept
 Serializable identity; non-empty and unique within its type once added.
uint64_t uid () const noexcept
 Process-unique id stamped by add(); names the asset, not the slot it sits in.
uint64_t version () const noexcept
 Change counter the backend keys GPU re-uploads on; moved by commit().
bool isHidden () const noexcept
 Added by ResourceManager::addPrivate: not user-facing, not saved.
nlohmann::json & sourceJson ()
 Mutable source JSON, allocating a null document if there is none.
const nlohmann::json & sourceJson () const
 Const source JSON; asserts hasSource(), so guard the call with it.

Public Attributes

std::vector< uint8_t > pixelData = {}
bool loading = false
 True while an async decode is in flight; AsyncLoaderSystem clears it.

Detailed Description

Texture asset combining Resource tracking with engine-level texture parameters.

Member Function Documentation

◆ isSrgb()

bool Vkm::Engine::TextureAsset::isSrgb ( ) const
inline

Whether the texture stores colour in sRGB.

Read off the internal format, which a decode in flight already carries.

Returns
True for SRGB8, SRGBA8 and BC7SRGBA.

◆ usage()

TextureUsage Vkm::Engine::TextureAsset::usage ( ) const
inline

What the texels mean, read off the internal format as isSrgb is.

Returns
The usage the texture was imported with.

Member Data Documentation

◆ pixelData

std::vector<uint8_t> Vkm::Engine::TextureAsset::pixelData = {}

Every level params.mipLevels names, level 0 first, tightly packed: texels, or 4x4 blocks for a BC format.


The documentation for this struct was generated from the following file: