Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
Revision.hpp File Reference

What a resource's content is, as a number that changes whenever it does. More...

#include "Types.hpp"
#include <atomic>
Include dependency graph for Revision.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  esengine

Functions

u64 esengine::nextRevision ()
 A revision no content has had before. Never 0, which reads as "none".

Detailed Description

What a resource's content is, as a number that changes whenever it does.

A mesh, a material, a texture, a probe grid each carry a revision: taken from here when their content is made and again whenever it changes. A reader that keeps what it derived from one (the renderer's per-entity record of a draw) keeps the revision beside it and asks again only when the revision moved. One counter for every kind, so a revision is unique across them all: a released resource whose memory or slot a new one reuses is never taken for it.

The engine's components say the same of themselves with change stamps (Registry::changedSince); resources are not in the registry, so they say it here.

Definition in file Revision.hpp.