Engine → Renderer → material_asset.h
material_asset
| Type | Class |
| Namespace | conjure::renderer |
| Include File Path | engine/include/conjure/renderer/material_asset.h |
| Source File Path | engine/src/renderer/assets/material_asset.cpp |
| API ↗ | Rendering, Renderer assets |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | material_asset(); | |
| public | explicit material_asset(
material_desc desc,
std::string name = {}); | |
| public | material_asset(
const material_asset &) = default; | |
| public | material_asset(
material_asset &&) noexcept = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~material_asset(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mDesc | material_desc | {} | |
| private | mName | std::string | {} |
Functions
Public
desc
desc[[nodiscard]] const material_desc &desc() const noexcept;[[nodiscard]] material_desc &desc() noexcept;name
name[[nodiscard]] std::string_view name() const noexcept;parse_blob
parse_blob[[nodiscard]] static core::result<material_asset> parse_blob(
std::span<const std::byte> bytes);parse_json over a blob's bytes.
parse_json
parse_json[[nodiscard]] static core::result<material_asset> parse_json(
std::string_view text);Parses the JSON form. Fails with PARSE_FAILURE for invalid JSON and INVALID_ARGUMENT for a wrong member type, an unknown enumerator or a malformed uuid.
set_name
set_namevoid set_name(
std::string name);texture_flags
texture_flags[[nodiscard]] u32 texture_flags() const noexcept;Bit i set when texture slot i references an asset (non-null uuid), bound or not.
to_json
to_json[[nodiscard]] std::string to_json() const;The canonical JSON form (sorted keys, deterministic).
write_blob
write_blob[[nodiscard]] std::vector<std::byte> write_blob() const;The JSON form as blob bytes.
Operator Overloads
Public
operator=
operator=material_asset &operator=(
const material_asset &) = default;material_asset &operator=(
material_asset &&) noexcept = default;operator==
operator==[[nodiscard]] bool operator==(
const material_asset &other) const noexcept;