Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
GfxContent.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
11#pragma once
12
13#include "../../core/Types.hpp"
14
15namespace esengine {
16
25
30class GfxContent {
31public:
32 static constexpr GfxContent transient() { return GfxContent{GfxContentKind::Transient, 0, 0}; }
33 static constexpr GfxContent retained() { return GfxContent{GfxContentKind::Retained, 0, 0}; }
34 static constexpr GfxContent sourced(u32 provider, u32 key) {
35 return GfxContent{GfxContentKind::Sourced, provider, key};
36 }
37
38 constexpr GfxContentKind kind() const { return kind_; }
39 constexpr u32 provider() const { return provider_; }
40 constexpr u32 key() const { return key_; }
41
42private:
44 : kind_(kind), provider_(provider), key_(key) {}
45
46 GfxContentKind kind_;
47 u32 provider_;
48 u32 key_;
49};
50
51} // namespace esengine
Core type definitions and utilities for ESEngine.
A content policy. provider names who refills a Sourced object and key what it refills; both are the p...
constexpr u32 provider() const
static constexpr GfxContent transient()
constexpr u32 key() const
static constexpr GfxContent retained()
constexpr GfxContentKind kind() const
static constexpr GfxContent sourced(u32 provider, u32 key)
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
std::uint8_t u8
Unsigned 8-bit integer.
Definition Types.hpp:41
@ Retained
The device keeps the last bytes it was given and uploads them again.
@ Transient
Rewritten before every use. Recovery recreates the storage zero-filled.
@ Sourced
A provider outside the device refills it; until then it is owed.