Skip to content

Engine → Renderer

texture_asset.h

The CPU texture asset. Mips are generated on the CPU at import (box filter, sRGB-aware) and stored in the .ctex blob, so the GPU path is upload-only. Decoding goes through libjxl (JPEG XL) or stb_image (PNG, JPEG, TGA, BMP) in engine/src, chosen by the file's signature; the public API only sees bytes.

Structs

File Description
texture_import_settings Importer settings, mirrored by the JSON object { "colourSpace": "srgb" | "linear", "filter": "linear" | "point", "wrap": "repeat" | "clamp" | "mirror", "generateMips": true }.
texture_mip One mip level, tightly packed rows of bytes_per_pixel(format) pixels.

Classes

File Description
texture_asset
texture_importer The texture importer: .png .jpg .jpeg .tga .bmp .jxl -> one .ctex blob (decode + CPU mips). The file's signature picks the decoder, so a misnamed file still imports.
texture_loader The conjure.renderer.texture loader; the fallback is a 1x1 white texture.

Enumerations

sampler_filter

enum class sampler_filter : u8 {
    LINEAR = 0,
    POINT
};

texture_colour_space

enum class texture_colour_space : u8 {
    SRGB = 0,
    LINEAR
};

texture_wrap

enum class texture_wrap : u8 {
    REPEAT = 0,
    CLAMP,
    MIRROR
};

Constants

Name Type Value Description
TEXTURE_ASSET_TYPE_NAME inline constexpr std::string_view "conjure.renderer.texture"
TEXTURE_BLOB_VERSION inline constexpr u32 1
TEXTURE_EXTENSIONS inline constexpr std::array<std::string_view, 6> { ".png", ".jpg", ".jpeg", ".tga", ".bmp", ".jxl" }
TEXTURE_IMPORTER_ID inline constexpr std::string_view "conjure.renderer.texture"
TEXTURE_IMPORTER_VERSION inline constexpr u32 2

Macros

CONJURE_DECLARE_ASSET_TYPE

CONJURE_DECLARE_ASSET_TYPE(conjure::renderer::texture_asset, "conjure.renderer.texture")

Functions

Public

mip_count_for

[[nodiscard]] CONJURE_API u32 mip_count_for(
    u32 width,
    u32 height) noexcept;

Number of mip levels of a full chain down to 1x1.

to_string

[[nodiscard]] CONJURE_API std::string_view to_string(
    texture_colour_space value) noexcept;
[[nodiscard]] CONJURE_API std::string_view to_string(
    sampler_filter value) noexcept;
[[nodiscard]] CONJURE_API std::string_view to_string(
    texture_wrap value) noexcept;