From 22edd4fb9d02ca65b4626f930ede3e153c74345f Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 7 Jul 2023 15:55:24 -0700 Subject: [PATCH] glfw: 100% usable via package manager Signed-off-by: Stephen Gutekanst --- libs/glfw/.gitmodules | 6 - libs/glfw/build.zig | 184 +++----------------------- libs/glfw/build.zig.zon | 4 + libs/glfw/libs/xcode-frameworks | 1 - libs/glfw/src/Monitor.zig | 25 ++-- libs/glfw/src/Window.zig | 49 +++++-- libs/glfw/src/main.zig | 15 +++ libs/glfw/src/sources_all.c | 17 --- libs/glfw/src/sources_linux.c | 7 - libs/glfw/src/sources_linux_wayland.c | 4 - libs/glfw/src/sources_linux_x11.c | 5 - libs/glfw/src/sources_macos.c | 7 - libs/glfw/src/sources_macos.m | 9 -- libs/glfw/src/sources_windows.c | 9 -- libs/glfw/upstream | 1 - 15 files changed, 95 insertions(+), 248 deletions(-) delete mode 100644 libs/glfw/.gitmodules delete mode 160000 libs/glfw/libs/xcode-frameworks delete mode 100644 libs/glfw/src/sources_all.c delete mode 100644 libs/glfw/src/sources_linux.c delete mode 100644 libs/glfw/src/sources_linux_wayland.c delete mode 100644 libs/glfw/src/sources_linux_x11.c delete mode 100644 libs/glfw/src/sources_macos.c delete mode 100644 libs/glfw/src/sources_macos.m delete mode 100644 libs/glfw/src/sources_windows.c delete mode 160000 libs/glfw/upstream diff --git a/libs/glfw/.gitmodules b/libs/glfw/.gitmodules deleted file mode 100644 index effc39bd..00000000 --- a/libs/glfw/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "libs/xcode-frameworks"] - path = libs/xcode-frameworks - url = https://github.com/hexops/xcode-frameworks -[submodule "upstream"] - path = upstream - url = https://github.com/hexops-graveyard/glfw diff --git a/libs/glfw/build.zig b/libs/glfw/build.zig index 09491141..d6d0aab8 100644 --- a/libs/glfw/build.zig +++ b/libs/glfw/build.zig @@ -73,11 +73,17 @@ pub fn module(b: *std.Build) *std.build.Module { } pub fn link(b: *Build, step: *std.build.CompileStep, options: Options) !void { - if (options.shared) step.defineCMacro("GLFW_DLL", null); - const lib = try buildLibrary(b, step.optimize, step.target, options); - step.linkLibrary(lib); - addGLFWIncludes(step); - linkGLFWDependencies(b, step, options); + _ = options; + step.linkLibrary(b.dependency("glfw", .{ + .target = step.target, + .optimize = step.optimize, + }).artifact("glfw")); + + step.linkLibrary(b.dependency("vulkan_headers", .{ + .target = step.target, + .optimize = step.optimize, + }).artifact("vulkan-headers")); + if (step.target_info.target.os.tag == .macos) { // TODO(build-system): This cannot be imported with the Zig package manager // error: TarUnsupportedFileType @@ -91,162 +97,6 @@ pub fn link(b: *Build, step: *std.build.CompileStep, options: Options) !void { } } -fn buildLibrary(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget, options: Options) !*std.build.CompileStep { - // TODO(build-system): https://github.com/hexops/mach/issues/229#issuecomment-1100958939 - ensureDependencySubmodule(b.allocator, "upstream") catch return error.CannotEnsureDependency; - - const lib = if (options.shared) - b.addSharedLibrary(.{ .name = "glfw", .target = target, .optimize = optimize }) - else - b.addStaticLibrary(.{ .name = "glfw", .target = target, .optimize = optimize }); - - if (options.shared) - lib.defineCMacro("_GLFW_BUILD_DLL", null); - - addGLFWIncludes(lib); - try addGLFWSources(b, lib, options); - linkGLFWDependencies(b, lib, options); - - if (options.install_libs) - b.installArtifact(lib); - - return lib; -} - -fn addGLFWIncludes(step: *std.build.CompileStep) void { - step.addIncludePath(sdkPath("/upstream/glfw/include")); - step.addIncludePath(sdkPath("/src")); -} - -fn addGLFWSources(b: *Build, lib: *std.build.CompileStep, options: Options) std.mem.Allocator.Error!void { - const include_glfw_src = comptime "-I" ++ sdkPath("/upstream/glfw/src"); - switch (lib.target_info.target.os.tag) { - .windows => lib.addCSourceFiles(&.{ - sdkPath("/src/sources_all.c"), - sdkPath("/src/sources_windows.c"), - }, &.{ "-D_GLFW_WIN32", include_glfw_src }), - .macos => lib.addCSourceFiles(&.{ - sdkPath("/src/sources_all.c"), - sdkPath("/src/sources_macos.m"), - sdkPath("/src/sources_macos.c"), - }, &.{ "-D_GLFW_COCOA", include_glfw_src }), - else => { - // TODO(future): for now, Linux can't be built with musl: - // - // ``` - // ld.lld: error: cannot create a copy relocation for symbol stderr - // thread 2004762 panic: attempt to unwrap error: LLDReportedFailure - // ``` - var sources = std.ArrayList([]const u8).init(b.allocator); - var flags = std.ArrayList([]const u8).init(b.allocator); - try sources.append(sdkPath("/src/sources_all.c")); - try sources.append(sdkPath("/src/sources_linux.c")); - if (options.x11) { - try sources.append(sdkPath("/src/sources_linux_x11.c")); - try flags.append("-D_GLFW_X11"); - } - if (options.wayland) { - try sources.append(sdkPath("/src/sources_linux_wayland.c")); - try flags.append("-D_GLFW_WAYLAND"); - } - try flags.append(comptime "-I" ++ sdkPath("/upstream/glfw/src")); - // TODO(upstream): glfw can't compile on clang15 without this flag - try flags.append("-Wno-implicit-function-declaration"); - - lib.addCSourceFiles(sources.items, flags.items); - }, - } -} - -fn linkGLFWDependencies(b: *Build, step: *std.build.CompileStep, options: Options) void { - if (step.target_info.target.os.tag == .windows) { - step.linkLibrary(b.dependency("direct3d_headers", .{ - .target = step.target, - .optimize = step.optimize, - }).artifact("direct3d-headers")); - } - if (options.x11) { - step.linkLibrary(b.dependency("x11_headers", .{ - .target = step.target, - .optimize = step.optimize, - }).artifact("x11-headers")); - } - if (options.vulkan) { - step.linkLibrary(b.dependency("vulkan_headers", .{ - .target = step.target, - .optimize = step.optimize, - }).artifact("vulkan-headers")); - } - if (options.wayland) { - step.defineCMacro("WL_MARSHAL_FLAG_DESTROY", null); - step.linkLibrary(b.dependency("wayland_headers", .{ - .target = step.target, - .optimize = step.optimize, - }).artifact("wayland-headers")); - } - if (step.target_info.target.os.tag == .windows) @import("direct3d_headers").addLibraryPath(step); - - step.linkLibC(); - if (step.target_info.target.os.tag == .macos) { - // TODO(build-system): This cannot be imported with the Zig package manager - // error: TarUnsupportedFileType - // - // step.linkLibrary(b.dependency("xcode_frameworks", .{ - // .target = step.target, - // .optimize = step.optimize, - // }).artifact("xcode-frameworks")); - // @import("xcode_frameworks").addPaths(step); - xcode_frameworks.addPaths(b, step); - } - switch (step.target_info.target.os.tag) { - .windows => { - step.linkSystemLibraryName("gdi32"); - step.linkSystemLibraryName("user32"); - step.linkSystemLibraryName("shell32"); - if (options.opengl) { - step.linkSystemLibraryName("opengl32"); - } - if (options.gles) { - step.linkSystemLibraryName("GLESv3"); - } - }, - .macos => { - step.linkFramework("IOKit"); - step.linkFramework("CoreFoundation"); - if (options.metal) { - step.linkFramework("Metal"); - } - if (options.opengl) { - step.linkFramework("OpenGL"); - } - step.linkSystemLibraryName("objc"); - step.linkFramework("AppKit"); - step.linkFramework("CoreServices"); - step.linkFramework("CoreGraphics"); - step.linkFramework("Foundation"); - }, - else => { - // Assume Linux-like - if (options.wayland) { - step.defineCMacro("WL_MARSHAL_FLAG_DESTROY", null); - } - }, - } -} - -fn ensureDependencySubmodule(allocator: std.mem.Allocator, path: []const u8) !void { - if (std.process.getEnvVarOwned(allocator, "NO_ENSURE_SUBMODULES")) |no_ensure_submodules| { - defer allocator.free(no_ensure_submodules); - if (std.mem.eql(u8, no_ensure_submodules, "true")) return; - } else |_| {} - var child = std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", path }, allocator); - child.cwd = sdkPath("/"); - child.stderr = std.io.getStdErr(); - child.stdout = std.io.getStdOut(); - - _ = try child.spawnAndWait(); -} - fn sdkPath(comptime suffix: []const u8) []const u8 { if (suffix[0] != '/') @compileError("suffix must be an absolute path"); return comptime blk: { @@ -277,7 +127,7 @@ fn sdkPath(comptime suffix: []const u8) []const u8 { const xcode_frameworks = struct { pub fn addPaths(b: *std.Build, step: *std.build.CompileStep) void { // branch: mach - xEnsureGitRepoCloned(b.allocator, "https://github.com/hexops/xcode-frameworks", "723aa55e9752c8c6c25d3413722b5fe13d72ac4f", "zig-cache/xcode_frameworks") catch |err| @panic(@errorName(err)); + xEnsureGitRepoCloned(b.allocator, "https://github.com/hexops/xcode-frameworks", "723aa55e9752c8c6c25d3413722b5fe13d72ac4f", xSdkPath("/zig-cache/xcode_frameworks")) catch |err| @panic(@errorName(err)); step.addFrameworkPath("zig-cache/xcode_frameworks/Frameworks"); step.addSystemIncludePath("zig-cache/xcode_frameworks/include"); @@ -291,7 +141,7 @@ const xcode_frameworks = struct { xEnsureGit(allocator); - if (std.fs.cwd().openDir(dir, .{})) |_| { + if (std.fs.openDirAbsolute(dir, .{})) |_| { const current_revision = try xGetCurrentGitRevision(allocator, dir); if (!std.mem.eql(u8, current_revision, revision)) { // Reset to the desired revision @@ -355,4 +205,12 @@ const xcode_frameworks = struct { return false; } } + + fn xSdkPath(comptime suffix: []const u8) []const u8 { + if (suffix[0] != '/') @compileError("suffix must be an absolute path"); + return comptime blk: { + const root_dir = std.fs.path.dirname(@src().file) orelse "."; + break :blk root_dir ++ suffix; + }; + } }; diff --git a/libs/glfw/build.zig.zon b/libs/glfw/build.zig.zon index 6155f240..2adc8cf8 100644 --- a/libs/glfw/build.zig.zon +++ b/libs/glfw/build.zig.zon @@ -18,5 +18,9 @@ .url = "https://github.com/hexops/x11-headers/archive/99af89c7bfdc7db503f3a7003571f8e81bcd09f3.tar.gz", .hash = "1220e6bd3186841c1da38d862d52ba88dec9633d24f409eda27627321937419a0ddb", }, + .glfw = .{ + .url = "https://github.com/hexops/glfw/archive/49c21c3d2fcaf9799b593f5320ce8e598a692c74.tar.gz", + .hash = "12200a907165afc4c099d4d19e2f7ce9923a72116006d8f5f5af3a9a071fa66171d2", + }, }, } diff --git a/libs/glfw/libs/xcode-frameworks b/libs/glfw/libs/xcode-frameworks deleted file mode 160000 index 723aa55e..00000000 --- a/libs/glfw/libs/xcode-frameworks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 723aa55e9752c8c6c25d3413722b5fe13d72ac4f diff --git a/libs/glfw/src/Monitor.zig b/libs/glfw/src/Monitor.zig index 0b09c2c0..868872e1 100644 --- a/libs/glfw/src/Monitor.zig +++ b/libs/glfw/src/Monitor.zig @@ -186,7 +186,7 @@ pub inline fn getUserPointer(self: Monitor, comptime T: type) ?*T { /// then by resolution area (the product of width and height), then resolution width and finally /// by refresh rate. /// -/// Possible errors include glfw.ErrorCode.PlatformError. +/// Possible errors include glfw.ErrorCode.PlatformError, glfw.ErrorCode.FeatureUnavailable. /// Returns null in the event of an error. /// /// The returned slice memory is owned by the caller. @@ -194,7 +194,10 @@ pub inline fn getUserPointer(self: Monitor, comptime T: type) ?*T { /// @thread_safety This function must only be called from the main thread. /// /// see also: monitor_modes, glfw.Monitor.getVideoMode -// +/// +/// wayland: Gamma handling is privileged protocol, this function will thus never be implemented and +/// emits glfw.ErrorCode.FeatureUnavailable +/// /// TODO(glfw): rewrite this to not require any allocation. pub inline fn getVideoModes(self: Monitor, allocator: mem.Allocator) mem.Allocator.Error!?[]VideoMode { internal_debug.assertInitialized(); @@ -216,11 +219,14 @@ pub inline fn getVideoModes(self: Monitor, allocator: mem.Allocator) mem.Allocat /// full screen window for that monitor, the return value will depend on whether that window is /// iconified. /// -/// Possible errors include glfw.ErrorCode.PlatformError. +/// Possible errors include glfw.ErrorCode.PlatformError, glfw.ErrorCode.FeatureUnavailable. /// Additionally returns null in the event of an error. /// /// @thread_safety This function must only be called from the main thread. /// +/// wayland: Gamma handling is a privileged protocol, this function will thus never be implemented +/// and will thus never be implemented and emits glfw.ErrorCode.FeatureUnavailable +/// /// see also: monitor_modes, glfw.Monitor.getVideoModes pub inline fn getVideoMode(self: Monitor) ?VideoMode { internal_debug.assertInitialized(); @@ -239,10 +245,10 @@ pub inline fn getVideoMode(self: Monitor) ?VideoMode { /// /// For gamma correct rendering with OpenGL or OpenGL ES, see the glfw.srgb_capable hint. /// -/// Possible errors include glfw.ErrorCode.InvalidValue and glfw.ErrorCode.PlatformError. +/// Possible errors include glfw.ErrorCode.PlatformError, glfw.ErrorCode.FeatureUnavailable. /// -/// wayland: Gamma handling is a privileged protocol, this function will thus never be implemented -/// and emits glfw.ErrorCode.PlatformError. +/// wayland: Gamma handling is privileged protocol, this function will thus never be implemented and +/// emits glfw.ErrorCode.FeatureUnavailable /// /// @thread_safety This function must only be called from the main thread. /// @@ -265,8 +271,7 @@ pub inline fn setGamma(self: Monitor, gamma: f32) void { /// Additionally returns null in the event of an error. /// /// wayland: Gamma handling is a privileged protocol, this function will thus never be implemented -/// and returns glfw.ErrorCode.PlatformError. -/// TODO: Is the documentation obsolete? On wayland the error returned is FeatureUnavailable +/// and returns glfw.ErrorCode.FeatureUnavailable. /// /// The returned gamma ramp is `.owned = true` by GLFW, and is valid until the monitor is /// disconnected, this function is called again, or `glfw.terminate()` is called. @@ -292,13 +297,13 @@ pub inline fn getGammaRamp(self: Monitor) ?GammaRamp { /// /// For gamma correct rendering with OpenGL or OpenGL ES, see the glfw.srgb_capable hint. /// -/// Possible errors include glfw.ErrorCode.PlatformError. +/// Possible errors include glfw.ErrorCode.PlatformError, glfw.ErrorCode.FeatureUnavailable. /// /// The size of the specified gamma ramp should match the size of the current ramp for that /// monitor. On win32, the gamma ramp size must be 256. /// /// wayland: Gamma handling is a privileged protocol, this function will thus never be implemented -/// and emits glfw.ErrorCode.PlatformError. +/// and returns glfw.ErrorCode.FeatureUnavailable. /// /// @pointer_lifetime The specified gamma ramp is copied before this function returns. /// diff --git a/libs/glfw/src/Window.zig b/libs/glfw/src/Window.zig index 86080d76..f7fccbff 100644 --- a/libs/glfw/src/Window.zig +++ b/libs/glfw/src/Window.zig @@ -50,6 +50,8 @@ const Hint = enum(c_int) { transparent_framebuffer = c.GLFW_TRANSPARENT_FRAMEBUFFER, focus_on_show = c.GLFW_FOCUS_ON_SHOW, mouse_passthrough = c.GLFW_MOUSE_PASSTHROUGH, + position_x = c.GLFW_POSITION_X, + position_y = c.GLFW_POSITION_Y, scale_to_monitor = c.GLFW_SCALE_TO_MONITOR, /// Framebuffer hints @@ -112,6 +114,9 @@ const Hint = enum(c_int) { /// Windows specific win32_keyboard_menu = c.GLFW_WIN32_KEYBOARD_MENU, + + /// Allows specification of the Wayland app_id. + wayland_app_id = c.GLFW_WAYLAND_APP_ID, }; /// Window hints @@ -128,6 +133,9 @@ pub const Hints = struct { transparent_framebuffer: bool = false, focus_on_show: bool = true, mouse_passthrough: bool = false, + position_x: c_int = @intFromEnum(Position.any), + position_y: c_int = @intFromEnum(Position.any), + scale_to_monitor: bool = false, /// Framebuffer hints @@ -194,6 +202,9 @@ pub const Hints = struct { /// Windows specific win32_keyboard_menu: bool = false, + /// Allows specification of the Wayland app_id. + wayland_app_id: [:0]const u8 = "", + pub const PositiveCInt = std.math.IntFittingRange(0, std.math.maxInt(c_int)); pub const ClientAPI = enum(c_int) { @@ -226,6 +237,18 @@ pub const Hints = struct { opengl_core_profile = c.GLFW_OPENGL_CORE_PROFILE, }; + pub const Position = enum(c_int) { + /// By default, newly created windows use the placement recommended by the window system, + /// + /// To create the window at a specific position, make it initially invisible using the + /// Window.Hint.visible hint, set its Window.Hint.position and then Window.hide() it. + /// + /// To create the window at a specific position, set the Window.Hint.position_x and + /// Window.Hint.position_y hints before creation. To restore the default behavior, set + /// either or both hints back to Window.Hints.Position.any + any = @bitCast(c.GLFW_ANY_POSITION), + }; + fn set(hints: Hints) void { internal_debug.assertInitialized(); inline for (comptime std.meta.fieldNames(Hint)) |field_name| { @@ -241,6 +264,7 @@ pub const Hints = struct { ContextRobustness, ContextReleaseBehavior, OpenGLProfile, + Position, => c.glfwWindowHint(hint_tag, @intFromEnum(hint_value)), [:0]const u8 => c.glfwWindowHintString(hint_tag, hint_value.ptr), @@ -820,8 +844,8 @@ pub inline fn setOpacity(self: Window, opacity: f32) void { /// This function iconifies (minimizes) the specified window if it was previously restored. If the /// window is already iconified, this function does nothing. /// -/// If the specified window is a full screen window, the original monitor resolution is restored -/// until the window is restored. +/// If the specified window is a full screen window, GLFW restores the original video mode of the +/// monitor. The window's desired video mode is set again when the window is restored. /// /// Possible errors include glfw.ErrorCode.PlatformError. /// @@ -841,8 +865,8 @@ pub inline fn iconify(self: Window) void { /// This function restores the specified window if it was previously iconified (minimized) or /// maximized. If the window is already restored, this function does nothing. /// -/// If the specified window is a full screen window, the resolution chosen for the window is -/// restored on the selected monitor. +/// If the specified window is an iconified full screen window, its desired video mode is set +/// again for its monitor when the window is restored. /// /// Possible errors include glfw.ErrorCode.PlatformError. /// @@ -1104,6 +1128,9 @@ pub const Attrib = enum(c_int) { /// /// @thread_safety This function must only be called from the main thread. /// +/// wayland: The Wayland protocol provides no way to check whether a window is iconified, so +/// glfw.Window.Attrib.iconified always returns `false`. +/// /// see also: window_attribs, glfw.Window.setAttrib pub inline fn getAttrib(self: Window, attrib: Attrib) i32 { internal_debug.assertInitialized(); @@ -1125,8 +1152,8 @@ pub inline fn getAttrib(self: Window, attrib: Attrib) i32 { /// /// @param[in] attrib A supported window attribute. /// -/// Possible errors include glfw.ErrorCode.InvalidEnum, glfw.ErrorCode.InvalidValue and -/// glfw.ErrorCode.PlatformError. +/// Possible errors include glfw.ErrorCode.InvalidEnum, glfw.ErrorCode.InvalidValue, +/// glfw.ErrorCode.PlatformError, glfw.ErrorCode.FeatureUnavailable /// /// Calling glfw.Window.getAttrib will always return the latest /// value, even if that value is ignored by the current mode of the window. @@ -1527,6 +1554,9 @@ pub const InputModeCursor = enum(c_int) { /// Hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful /// for implementing for example 3D camera controls. disabled = c.GLFW_CURSOR_DISABLED, + + /// Makes the cursor visible but confines it to the content area of the window. + captured = c.GLFW_CURSOR_CAPTURED, }; /// Sets the input mode of the cursor, whether it should behave normally, be hidden, or grabbed. @@ -1669,8 +1699,9 @@ pub inline fn setInputMode(self: Window, mode: InputMode, value: anytype) void { /// Returns the last reported press state of a keyboard key for the specified window. /// /// This function returns the last press state reported for the specified key to the specified -/// window. The returned state is one of `true` (pressed) or `false` (released). The higher-level -/// action `glfw.Action.repeat` is only reported to the key callback. +/// window. The returned state is one of `true` (pressed) or `false` (released). +/// +/// * `glfw.Action.repeat` is only reported to the key callback. /// /// If the `glfw.sticky_keys` input mode is enabled, this function returns `glfw.Action.press` the /// first time you call it for a key that was pressed, even if that key has already been released. @@ -1773,7 +1804,7 @@ pub inline fn getCursorPos(self: Window) CursorPos { /// @param[in] xpos The desired x-coordinate, relative to the left edge of the content area. /// @param[in] ypos The desired y-coordinate, relative to the top edge of the content area. /// -/// Possible errors include glfw.ErrorCode.PlatformError. +/// Possible errors include glfw.ErrorCode.PlatformError, glfw.ErrorCode.FeatureUnavailable. /// /// wayland: This function will only work when the cursor mode is `glfw.cursor_disabled`, otherwise /// it will do nothing. diff --git a/libs/glfw/src/main.zig b/libs/glfw/src/main.zig index b94e4e35..021102c6 100644 --- a/libs/glfw/src/main.zig +++ b/libs/glfw/src/main.zig @@ -225,6 +225,11 @@ const InitHint = enum(c_int) { /// X11 specific init hint. x11_xcb_vulkan_surface = c.GLFW_X11_XCB_VULKAN_SURFACE, + + /// Wayland specific init hint. + /// + /// Possible values are `WaylandLibdecorInitHint` enums. + wayland_libdecor = c.GLFW_WAYLAND_LIBDECOR, }; /// Angle platform type hints for glfw.InitHint.angle_platform_type @@ -238,6 +243,16 @@ pub const AnglePlatformType = enum(c_int) { metal = c.GLFW_ANGLE_PLATFORM_TYPE_METAL, }; +/// Wayland libdecor hints for glfw.InitHint.wayland_libdecor +/// +/// libdecor is important for GNOME, since GNOME does not implement server side decorations on +/// wayland. libdecor is loaded dynamically at runtime, so in general enabling it is always +/// safe to do. It is enabled by default. +pub const WaylandLibdecorInitHint = enum(c_int) { + wayland_prefer_libdecor = c.GLFW_WAYLAND_PREFER_LIBDECOR, + wayland_disable_libdecor = c.GLFW_WAYLAND_DISABLE_LIBDECOR, +}; + /// Platform type hints for glfw.InitHint.platform pub const PlatformType = enum(c_int) { /// Enables automatic platform detection. diff --git a/libs/glfw/src/sources_all.c b/libs/glfw/src/sources_all.c deleted file mode 100644 index 79fa9abe..00000000 --- a/libs/glfw/src/sources_all.c +++ /dev/null @@ -1,17 +0,0 @@ -// MacOS: this must be defined for macOS 13.3 and older. -#define __kernel_ptr_semantics - -// General sources -#include "monitor.c" -#include "init.c" -#include "vulkan.c" -#include "input.c" -#include "osmesa_context.c" -#include "egl_context.c" -#include "context.c" -#include "window.c" -#include "platform.c" -#include "null_init.c" -#include "null_monitor.c" -#include "null_window.c" -#include "null_joystick.c" diff --git a/libs/glfw/src/sources_linux.c b/libs/glfw/src/sources_linux.c deleted file mode 100644 index 7b54172d..00000000 --- a/libs/glfw/src/sources_linux.c +++ /dev/null @@ -1,7 +0,0 @@ -// General Linux-like sources -#include "posix_time.c" -#include "posix_thread.c" -#include "linux_joystick.c" -#include "xkb_unicode.c" -#include "posix_module.c" -#include "posix_poll.c" diff --git a/libs/glfw/src/sources_linux_wayland.c b/libs/glfw/src/sources_linux_wayland.c deleted file mode 100644 index c96d0e77..00000000 --- a/libs/glfw/src/sources_linux_wayland.c +++ /dev/null @@ -1,4 +0,0 @@ -// General Linux-like sources -#include "wl_monitor.c" -#include "wl_window.c" -#include "wl_init.c" diff --git a/libs/glfw/src/sources_linux_x11.c b/libs/glfw/src/sources_linux_x11.c deleted file mode 100644 index e2e1c79e..00000000 --- a/libs/glfw/src/sources_linux_x11.c +++ /dev/null @@ -1,5 +0,0 @@ -// General Linux-like sources -#include "x11_init.c" -#include "x11_window.c" -#include "x11_monitor.c" -#include "glx_context.c" diff --git a/libs/glfw/src/sources_macos.c b/libs/glfw/src/sources_macos.c deleted file mode 100644 index 958259c6..00000000 --- a/libs/glfw/src/sources_macos.c +++ /dev/null @@ -1,7 +0,0 @@ -// MacOS: this must be defined for macOS 13.3 and older. -#define __kernel_ptr_semantics - -// MacOS-specific sources -#include "cocoa_time.c" -#include "posix_thread.c" -#include "posix_module.c" diff --git a/libs/glfw/src/sources_macos.m b/libs/glfw/src/sources_macos.m deleted file mode 100644 index d0701a73..00000000 --- a/libs/glfw/src/sources_macos.m +++ /dev/null @@ -1,9 +0,0 @@ -// MacOS: this must be defined for macOS 13.3 and older. -#define __kernel_ptr_semantics - -// MacOS-specific sources -#include "cocoa_joystick.m" -#include "cocoa_init.m" -#include "cocoa_window.m" -#include "cocoa_monitor.m" -#include "nsgl_context.m" diff --git a/libs/glfw/src/sources_windows.c b/libs/glfw/src/sources_windows.c deleted file mode 100644 index 7fd711f3..00000000 --- a/libs/glfw/src/sources_windows.c +++ /dev/null @@ -1,9 +0,0 @@ -// Windows-specific sources -#include "win32_thread.c" -#include "wgl_context.c" -#include "win32_init.c" -#include "win32_monitor.c" -#include "win32_time.c" -#include "win32_joystick.c" -#include "win32_window.c" -#include "win32_module.c" diff --git a/libs/glfw/upstream b/libs/glfw/upstream deleted file mode 160000 index 915548c8..00000000 --- a/libs/glfw/upstream +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 915548c8694c1b4a96abd5a8729d0e777582d077