Skip to content

Game materials

Generated from engine/render/material.h at f525bc6. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.

Browse the render module

Audience: game code.

#include "engine/render/material.h" · namespace labrador

enum class MaterialKind
{
d3d11,
d3d12,
spirv,
glsl,
null,
};

Build output from labrador_add_material. The selected backend determines the kind: Direct3D bytecode, SPIR-V, NUL-terminated GLSL, or empty null data. name identifies the authored source in a runtime diagnostic. Renderer::add_material copies both spans; their storage need not survive it.

MaterialKind kind = MaterialKind::null;
std::span<const unsigned char> bytes;
std::string_view name;

A material registered with one Renderer. Default construction is unresolved. Handles survive resize and device restoration and expire with their renderer; another renderer refuses them.

MaterialHandle() = default;
bool valid() const;
int index() const;
friend bool operator==(MaterialHandle, MaterialHandle) = default;

Named in the public declarations above: MaterialTable.

The files that include this header directly. A file can also reach it through another header.

Documentation for Labrador v0.4.0. Built from Labrador f525bc6 of 2026-11-17.

All documentation versions