-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.zig
41 lines (34 loc) · 1.21 KB
/
main.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//!zig-autodoc-section: BaseVulkan
//! Template for a Vulkan program using GLFW3.
// Build using Zig 0.13.0
// NOTE: Edit tasks.json and build.zig replacing hard coded paths to Vulkan SDK folder.
// ============================================================================
// Globals.
//
const std = @import("std");
const win = struct {
usingnamespace std.os.windows;
usingnamespace std.os.windows.kernel32;
};
const vk = @import("vulkan.zig");
// ============================================================================
// Main.
//
pub fn main() !void {
vk.initWindow();
try vk.initVulkan();
try vk.loop();
vk.deinit();
}
// Functions to switch to /Subsystem Windows instead of console.
//
// pub export fn wWinMain(hInstance: win.HINSTANCE, hPrevInstance: ?win.HINSTANCE,
// pCmdLine: ?win.LPWSTR, nCmdShow: win.INT) callconv(win.WINAPI) win.INT {
// _ = hInstance; _ = &hPrevInstance; _ = &pCmdLine; _ = nCmdShow;
// return 0;
// }
// // Fix for libc linking error.
// pub export fn WinMain(hInstance: win.HINSTANCE, hPrevInstance: ?win.HINSTANCE,
// pCmdLine: ?win.LPWSTR, nCmdShow: win.INT) callconv(win.WINAPI) win.INT {
// return wWinMain(hInstance, hPrevInstance, pCmdLine, nCmdShow);
// }