This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
// primitive of the event loop. | |
// Ctx is typically a pointer to *This and data a pointer to the Users data. | |
// destroyData is called after the event has finished and must clean up the event to avoid leaks. | |
const Event = struct { | |
ctx: *anyopaque, | |
data: *anyopaque, | |
name: []const u8, | |
destroyData: *const fn (*anyopaque, *anyopaque) void, |