aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-06-28 00:38:05 +0200
committerdec05eba <dec05eba@protonmail.com>2024-06-28 00:38:05 +0200
commit27c5c9905dcec4bc7743cf67ed1db9b167af38a8 (patch)
treee53e649f99a857c6b24cd69d5ad5524401e1b1fe /src
parent8f012f3a7dad281c08e52aacda666507523583e5 (diff)
Make example smaller
Diffstat (limited to 'src')
-rw-r--r--src/main.zig8
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);