Skip to content

cf_make_texture_from_dds

Category: graphics
GitHub: cute_graphics.h


Creates a texture from a DDS file: block-compressed pixels and their mip chain, uploaded exactly as stored -- no decode, no recompress.

CF_Texture cf_make_texture_from_dds(const char* virtual_path);
Parameters Description
virtual_path A path to the DDS file, in the virtual file system.

Remarks

DDS is the interchange file for GPU-ready textures. Supported contents: BC1-BC7 (including sRGB variants and BC6H HDR), uncompressed RGBA8/BGRA8, full mip chains, cube maps, and 2D texture arrays. Block compression is the difference between shipping a texture-heavy 3d scene and running out of VRAM: BC formats are 4-8x smaller than RGBA8 on the GPU, not just on disk. Returns a zero handle when the file is malformed or the GPU lacks the format (cf_texture_supports_format) -- notably the GLES3/web backend has no BC support, so ship PNG/JPG fallbacks for web builds. See cute_dds.h for the underlying parser.

cf_make_texture_from_dds_mem
cf_make_texture
cf_texture_supports_format
cf_texture_update_layer_mip