blob: 0cd6922a479e73eb8c142ef1224204107db00cca (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "input.hpp"
#include "main.hpp"
[[noreturn]] void input_thread_main() {
euler::syscall::set_thread_name("input thread");
while (true) {
auto result = euler::syscall::get_input_packet();
if (std::holds_alternative<euler::syscall::mouse_packet>(result)) {
auto packet = std::get<euler::syscall::mouse_packet>(result);
r->lock();
r->bump_cursor(packet.x_changed, packet.y_changed);
r->unlock();
r->dispatch_render();
}
}
}
|