From f335232b860ee55b6bfc9e703f7798ea41c53c28 Mon Sep 17 00:00:00 2001 From: treeform Date: Wed, 9 Sep 2026 07:04:25 -0700 Subject: [PATCH] Export a no-op loadExtensions on macOS for the Metal and CPU backends Windy already exports loadExtensions on every backend for Win32 (a no-op under useDirectX, useVulkan and useCpu) and for Emscripten. macOS only had it via the opengl import, so under useMetal4 or useCpu callers had nothing to call and downstream libraries such as Silky defined their own stand-in. That stand-in then collided with Windy's on Win32 CPU builds and made every loadExtensions() call ambiguous. Windy is the one place that knows which backend is active, so it should be the one place that owns this symbol. With this, loadExtensions() can be called unconditionally on every platform and backend Windy supports. Co-Authored-By: Claude Fable 5.1 --- src/windy/platforms/macos/platform.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/windy/platforms/macos/platform.nim b/src/windy/platforms/macos/platform.nim index ccf833d..2e09ee2 100644 --- a/src/windy/platforms/macos/platform.nim +++ b/src/windy/platforms/macos/platform.nim @@ -1243,6 +1243,12 @@ proc swapBuffers*(window: Window) = else: window.inner.contentView.NSOpenGLView.openGLContext.flushBuffer() +when defined(useMetal4) or defined(useCpu): + proc loadExtensions*() = + ## Nothing to load without OpenGL. Exported so callers can call + ## loadExtensions() on every backend, as Win32 and Emscripten already allow. + discard + proc presentPixels*(window: Window, image: Image) = ## Presents a CPU-rendered Pixie image into the macOS window content view. when defined(useCpu):