Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
LoadingEyeReveal.h
Go to the documentation of this file.
1
#pragma once
2
#include <algorithm>
3
#include <cmath>
4
5
// The loading eye starts inside the pupil and pulls back over 78 seconds.
6
// Use an absolute monotonic clock: resource loading can reset the frame clock,
7
// and a shader preparation stall can span several seconds between draws.
8
class
LoadingEyeReveal
9
{
10
public
:
11
float
Progress
(
double
now)
12
{
13
if
(!std::isfinite(now))
return
progress
;
14
if
(
started
< 0)
started
= now;
15
progress
= (std::max)(
progress
,
float
((std::clamp)((now -
started
) / 78.0, 0.0, 1.0)));
16
return
progress
;
17
}
18
void
Reset
() {
started
= -1;
progress
= 0; }
19
private
:
20
double
started
= -1;
21
float
progress
= 0;
22
};
LoadingEyeReveal
Definition
LoadingEyeReveal.h:9
LoadingEyeReveal::started
double started
Definition
LoadingEyeReveal.h:20
LoadingEyeReveal::Reset
void Reset()
Definition
LoadingEyeReveal.h:18
LoadingEyeReveal::progress
float progress
Definition
LoadingEyeReveal.h:21
LoadingEyeReveal::Progress
float Progress(double now)
Definition
LoadingEyeReveal.h:11
LoadingEyeReveal.h
Generated on
for Rise by
1.18.0