Skip to content

Commit 511a2d1

Browse files
author
Filip Žmuk
authored
Add 3.4 platform selection (#36)
1 parent c337cb3 commit 511a2d1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/zglfw.zig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,25 @@ pub fn getProcAddress(procname: [*:0]const u8) callconv(.c) ?GlProc {
174174
}
175175
extern fn glfwGetProcAddress(procname: [*:0]const u8) callconv(.c) ?GlProc;
176176

177+
pub const Platform = enum(c_int) {
178+
win32 = 0x00060001,
179+
cocoa = 0x00060002,
180+
wayland = 0x00060003,
181+
x11 = 0x00060004,
182+
null = 0x00060005,
183+
_,
184+
};
185+
186+
pub fn getPlatform() Platform {
187+
return glfwGetPlatform();
188+
}
189+
extern fn glfwGetPlatform() Platform;
190+
191+
pub fn platformSupported(platform: Platform) bool {
192+
return glfwPlatformSupported(platform) == TRUE;
193+
}
194+
extern fn glfwPlatformSupported(Platform) Bool;
195+
177196
//--------------------------------------------------------------------------------------------------
178197
//
179198
// Keyboard/Mouse

0 commit comments

Comments
 (0)