From 27c5c9905dcec4bc7743cf67ed1db9b167af38a8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 28 Jun 2024 00:38:05 +0200 Subject: Make example smaller --- src/main.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main.zig b/src/main.zig index cc3ae26..b146834 100644 --- a/src/main.zig +++ b/src/main.zig @@ -7,16 +7,12 @@ pub fn main() !void { defer c.mgl_deinit(); var window: c.mgl_window = undefined; - var create_params = std.mem.zeroes(c.mgl_window_create_params); - create_params.size = .{ .x = 1280, .y = 720 }; - - if (c.mgl_window_create(&window, "mgl", &create_params) != 0) + if (c.mgl_window_create(&window, "mgl", &.{ .size = .{ .x = 1280, .y = 720 } }) != 0) return error.MglFailedToCreateWindow; defer c.mgl_window_deinit(&window); var font_file: c.mgl_memory_mapped_file = undefined; - var file_load_options = c.mgl_memory_mapped_file_load_options{ .readable = true, .writable = false }; - if (c.mgl_mapped_file_load("/usr/share/fonts/noto/NotoSans-Regular.ttf", &font_file, &file_load_options) != 0) + if (c.mgl_mapped_file_load("/usr/share/fonts/noto/NotoSans-Regular.ttf", &font_file, &.{ .readable = true, .writable = false }) != 0) return error.MglFailedToLoadFontFile; defer c.mgl_mapped_file_unload(&font_file); -- cgit v1.2.3