diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-06-28 00:38:05 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-06-28 00:38:05 +0200 |
commit | 27c5c9905dcec4bc7743cf67ed1db9b167af38a8 (patch) | |
tree | e53e649f99a857c6b24cd69d5ad5524401e1b1fe /src/main.zig | |
parent | 8f012f3a7dad281c08e52aacda666507523583e5 (diff) |
Make example smaller
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 8 |
1 files changed, 2 insertions, 6 deletions
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); |