diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 16:00:15 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 16:00:15 +0100 |
| commit | 8d062a90b1ffbe9e00334fa3e9e939406bd32141 (patch) | |
| tree | 20951bba89bbcdc3090e24d99eb9f91c0043f28e /src/screen/drm/event.zig | |
| parent | 0b6ee849722002a8bc7cc5374e3136bee4be2ccd (diff) | |
screen: add vsync and double buffering
Diffstat (limited to 'src/screen/drm/event.zig')
| -rw-r--r-- | src/screen/drm/event.zig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/screen/drm/event.zig b/src/screen/drm/event.zig new file mode 100644 index 0000000..201ced3 --- /dev/null +++ b/src/screen/drm/event.zig @@ -0,0 +1,31 @@ + +pub const EventType = enum(u32) { + vblank = 1, + page_flip_complete = 2, + crtc_sequence = 3, +}; + +pub const VBlankEvent = extern struct { + user_data: u64, + tv_sec: u32, + tv_usec: u32, + sequence: u32, + crtc_id: u32, +}; + +pub const CrtcSequenceEvent = extern struct { + user_data: u64, + time_ns: i64, + sequence: u64, +}; + +pub const EventPayload = extern union { + vblank: VBlankEvent, + crtc_sequence: CrtcSequenceEvent, +}; + +pub const Event = extern struct { + type: EventType, + length: u32, + payload: EventPayload, +}; |