Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
RandomSource.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3#include "RandomSource.hpp"
4
5namespace esengine {
6namespace {
7bool g_hasPendingSeed = false;
8u32 g_pendingSeed = 0;
9} // namespace
10
12 g_hasPendingSeed = true;
13 g_pendingSeed = seed;
14}
15
17 if (!g_hasPendingSeed) return false;
18 out = g_pendingSeed;
19 return true;
20}
21
22} // namespace esengine
The engine's randomness, and the only place its seed lives.
bool takePendingRandomSeed(u32 &out)
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
void setPendingRandomSeed(u32 seed)