Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
EngineSimulationClock.cs
2
6internal static class EngineSimulationClock
7{
8 private static long _simulationTick = HighResTimer.GetCurrentTick();
9 private static int _timerDriven;
10
13 internal static long GetCurrentTick() => Volatile.Read(ref _timerDriven) != 0
14 ? Interlocked.Read(ref _simulationTick)
15 : HighResTimer.GetCurrentTick();
16
19 internal static void BeginTimerDriven(long tick)
20 {
21 Interlocked.Exchange(ref _simulationTick, tick);
22 Volatile.Write(ref _timerDriven, 1);
23 }
24
27 internal static void SetTimerDrivenTick(long tick) =>
28 Interlocked.Exchange(ref _simulationTick, tick);
29
31 internal static void UseWallClock() => Volatile.Write(ref _timerDriven, 0);
32}