#include <glfw_event_loop.h>
Definition at line 14 of file glfw_event_loop.h.
◆ GLFWEventLoop() [1/2]
flutter::GLFWEventLoop::GLFWEventLoop |
( |
std::thread::id |
main_thread_id, |
|
|
const TaskExpiredCallback & |
on_task_expired |
|
) |
| |
Definition at line 14 of file glfw_event_loop.cc.
16 :
EventLoop(main_thread_id, on_task_expired) {}
EventLoop(std::thread::id main_thread_id, const TaskExpiredCallback &on_task_expired)
◆ ~GLFWEventLoop()
flutter::GLFWEventLoop::~GLFWEventLoop |
( |
| ) |
|
|
virtualdefault |
◆ GLFWEventLoop() [2/2]
◆ operator=()
◆ WaitUntil()
void flutter::GLFWEventLoop::WaitUntil |
( |
const TaskTimePoint & |
time | ) |
|
|
overrideprivatevirtual |
Implements flutter::EventLoop.
Definition at line 20 of file glfw_event_loop.cc.
20 {
21 const auto now = TaskTimePoint::clock::now();
22
23
24 using Seconds = std::chrono::duration<double, std::ratio<1>>;
25 const auto duration_to_wait = std::chrono::duration_cast<Seconds>(time - now);
26
27 if (duration_to_wait.count() > 0.0) {
28 ::glfwWaitEventsTimeout(duration_to_wait.count());
29 } else {
30
31
32
33 ::glfwPollEvents();
34 }
35}
◆ Wake()
void flutter::GLFWEventLoop::Wake |
( |
| ) |
|
|
overrideprivatevirtual |
The documentation for this class was generated from the following files: