support drop event
This commit is contained in:
22
src/main.zig
22
src/main.zig
@@ -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}),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user