support drop event

This commit is contained in:
David Allemang
2024-06-27 11:58:18 -04:00
parent 07c96af5d7
commit fbfa8ee8d6
3 changed files with 59 additions and 35 deletions

View File

@@ -93,18 +93,24 @@ fn render(
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const ally = gpa.allocator();
defer _ = gpa.detectLeaks();
const alloc = gpa.allocator();
try au.init(ally);
try au.init(alloc);
defer au.deinit();
// std.debug.print("Initialized!!\n", .{ });
while (!au.W.should_close()) {
for (au.wait_events()) |event| switch (event) {
.charMods => |e| std.debug.print("{any}\n", .{e}),
.mouseButton => |e| std.debug.print("{any}\n", .{e}),
// todo switch mode depending on if window is focused
const events = au.wait_events_timeout(0.10);
for (events) |u| switch (u) {
.cursorPos,
.windowPos,
.windowSize,
.framebufferSize,
.windowRefresh,
=> {},
else => |e| std.debug.print("{any}\n", .{e}),
};
}