vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
texture_asset.h
1#pragma once
2
3#include <vector>
4#include <string>
5
6#include "resource/resource.h"
7#include "resource/resource_handle.h"
8#include "resource/texture_format.h"
9
10namespace Vkm::Engine {
11
15struct TextureAsset : public Resource {
16 TextureParams params;
19 std::vector<uint8_t> pixelData = {};
21 bool loading = false;
22
30 bool isSrgb() const { return isSrgbFormat(params.internalFormat); }
31
37 TextureUsage usage() const { return textureUsageOf(params.internalFormat); }
38};
39
40using TextureHandle = Handle<TextureAsset>;
41
42} // namespace Vkm::Engine
Texture asset combining Resource tracking with engine-level texture parameters.
Definition texture_asset.h:15
bool isSrgb() const
Whether the texture stores colour in sRGB.
Definition texture_asset.h:30
bool loading
True while an async decode is in flight; AsyncLoaderSystem clears it.
Definition texture_asset.h:21
TextureUsage usage() const
What the texels mean, read off the internal format as isSrgb is.
Definition texture_asset.h:37
std::vector< uint8_t > pixelData
Definition texture_asset.h:19
Full sampling + storage description for a texture, consumed by the backend on upload.
Definition texture_format.h:77