HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
ttauri
GUI
vertical_sync_win32.hpp
1
// Copyright Take Vos 2019-2020.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "vertical_sync.hpp"
8
#include <span>
9
#include <thread>
10
#include <array>
11
12
namespace
tt {
13
14
class
vertical_sync_win32
final :
public
vertical_sync
{
15
public
:
16
vertical_sync_win32
()
noexcept
;
17
~vertical_sync_win32
()
override
;
18
19
[[nodiscard]]
hires_utc_clock::time_point
wait
() noexcept override;
20
21
private:
22
void
*_gdi;
23
unsigned
int
_adapter = 0;
24
unsigned
int
_video_present_source_id;
25
26
hires_utc_clock
::time_point _previous_frame_time_point;
27
std
::array<
hires_utc_clock
::duration, 15> _frame_duration_data;
28
size_t
_frame_duration_counter = 0;
29
30
void
open_adapter() noexcept;
31
void
close_adapter() noexcept;
32
35
[[nodiscard]]
hires_utc_clock
::duration average_frame_duration(
hires_utc_clock
::time_point frameTimestamp) noexcept;
36
};
37
38
}
std
STL namespace.
tt::vertical_sync
Definition
vertical_sync.hpp:13
tt::vertical_sync_win32
Definition
vertical_sync_win32.hpp:14
tt::vertical_sync_win32::wait
hires_utc_clock::time_point wait() noexcept override
Wait for the vertical sync.
tt::hires_utc_clock
Timestamp.
Definition
hires_utc_clock.hpp:19
std::chrono::time_point< hires_utc_clock >
Generated on Mon Apr 22 2024 12:53:38 for HikoGUI by
1.10.0