TachyonUI
1.1.0
High-performance UI for building tools.
Toggle main menu visibility
Loading...
Searching...
No Matches
gui_redraw.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <atomic>
4
#include <cstdint>
5
#include <mutex>
6
#include <vector>
7
8
namespace
tachyon
9
{
12
14
enum class
RedrawMode
: uint8_t
15
{
16
Always
,
17
WhenChanged
,
18
WhenNeeded
,
19
};
20
23
class
RedrawRequests
24
{
25
public
:
27
void
Request
() { m_now =
true
; }
29
void
RequestAt
(int64_t nanos);
31
bool
IsDue
(int64_t nowNanos)
const
;
33
int64_t
NextAt
()
const
;
35
void
Answer
(int64_t nowNanos);
36
37
private
:
38
std::atomic<bool> m_now =
false
;
39
mutable
std::mutex m_mutex;
40
std::vector<int64_t> m_at;
41
};
42
44
}
tachyon::RedrawRequests
Redraws asked for: now, or at a time on the steady clock (SteadyClockNowNanos).
Definition
gui_redraw.h:24
tachyon::RedrawRequests::Request
void Request()
A frame as soon as possible.
Definition
gui_redraw.h:27
tachyon::RedrawRequests::RequestAt
void RequestAt(int64_t nanos)
A frame at nanos.
tachyon::RedrawRequests::IsDue
bool IsDue(int64_t nowNanos) const
True when a frame was asked for now, or for nowNanos or before.
tachyon::RedrawRequests::Answer
void Answer(int64_t nowNanos)
At a frame's start: the requests it answers (now, and up to nowNanos) are done.
tachyon::RedrawRequests::NextAt
int64_t NextAt() const
The earliest time asked for; INT64_MAX when there's none.
tachyon::RedrawMode
RedrawMode
How often GUIApplication::Run draws a frame (GUIApplication::SetRedrawMode).
Definition
gui_redraw.h:15
tachyon::RedrawMode::WhenNeeded
@ WhenNeeded
sleeps until there's input, a redraw is asked for, a timer is due or something animates (the default)
Definition
gui_redraw.h:18
tachyon::RedrawMode::WhenChanged
@ WhenChanged
builds every frame at the refresh rate; records and presents only the windows whose draws changed
Definition
gui_redraw.h:17
tachyon::RedrawMode::Always
@ Always
every frame, as often as the display refreshes
Definition
gui_redraw.h:16
tachyon
Definition
gui_logging.h:24
gui_core
frame
gui_redraw.h
Generated by
1.18.0