glfw: fix cimport workaround errors for linux/windows
This commit is contained in:
parent
a945046224
commit
669ef41219
7 changed files with 40 additions and 33 deletions
15046
libs/glfw/src/cimport/c_darwin.zig
Normal file
15046
libs/glfw/src/cimport/c_darwin.zig
Normal file
File diff suppressed because it is too large
Load diff
65917
libs/glfw/src/cimport/c_darwin_native.zig
Normal file
65917
libs/glfw/src/cimport/c_darwin_native.zig
Normal file
File diff suppressed because it is too large
Load diff
4
libs/glfw/src/cimport/c_normal.zig
Normal file
4
libs/glfw/src/cimport/c_normal.zig
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub const c = @cImport({
|
||||
@cDefine("GLFW_INCLUDE_VULKAN", "1");
|
||||
@cInclude("GLFW/glfw3.h");
|
||||
});
|
||||
16
libs/glfw/src/cimport/c_normal_native.zig
Normal file
16
libs/glfw/src/cimport/c_normal_native.zig
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
pub fn import(comptime options: anytype) type {
|
||||
return @cImport({
|
||||
@cDefine("GLFW_INCLUDE_VULKAN", "1");
|
||||
@cInclude("GLFW/glfw3.h");
|
||||
if (options.win32) @cDefine("GLFW_EXPOSE_NATIVE_WIN32", "1");
|
||||
if (options.wgl) @cDefine("GLFW_EXPOSE_NATIVE_WGL", "1");
|
||||
if (options.cocoa) @cDefine("GLFW_EXPOSE_NATIVE_COCOA", "1");
|
||||
if (options.nsgl) @cDefine("GLFW_EXPOSE_NATIVE_NGSL", "1");
|
||||
if (options.x11) @cDefine("GLFW_EXPOSE_NATIVE_X11", "1");
|
||||
if (options.glx) @cDefine("GLFW_EXPOSE_NATIVE_GLX", "1");
|
||||
if (options.wayland) @cDefine("GLFW_EXPOSE_NATIVE_WAYLAND", "1");
|
||||
if (options.egl) @cDefine("GLFW_EXPOSE_NATIVE_EGL", "1");
|
||||
if (options.osmesa) @cDefine("GLFW_EXPOSE_NATIVE_OSMESA", "1");
|
||||
@cInclude("GLFW/glfw3native.h");
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue