From 36a3c1ef321d9a992d17691f655b9e14d867cc5b Mon Sep 17 00:00:00 2001 From: jgcodes2020 Date: Tue, 24 Oct 2023 18:17:06 -0400 Subject: [PATCH] Provide dummy endpoints for Cocoa/Win32 --- src/cocoa_init.m | 2 +- src/cocoa_platform.h | 2 +- src/cocoa_window.m | 10 +++++++++- src/win32_init.c | 2 +- src/win32_platform.h | 2 +- src/win32_window.c | 6 +++++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index b3831df1..d925b4bd 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -525,6 +525,7 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform) _glfwGetGammaRampCocoa, _glfwSetGammaRampCocoa, _glfwCreateWindowCocoa, + _glfwAttachWindowCocoa, _glfwDestroyWindowCocoa, _glfwSetWindowTitleCocoa, _glfwSetWindowIconCocoa, @@ -694,4 +695,3 @@ void _glfwTerminateCocoa(void) } #endif // _GLFW_COCOA - diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index 9f7d191d..76d79226 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -215,6 +215,7 @@ int _glfwInitCocoa(void); void _glfwTerminateCocoa(void); GLFWbool _glfwCreateWindowCocoa(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); +GLFWbool _glfwAttachWindowCocoa(_GLFWwindow* window, intptr_t native, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); void _glfwDestroyWindowCocoa(_GLFWwindow* window); void _glfwSetWindowTitleCocoa(_GLFWwindow* window, const char* title); void _glfwSetWindowIconCocoa(_GLFWwindow* window, int count, const GLFWimage* images); @@ -299,4 +300,3 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); void _glfwDestroyContextNSGL(_GLFWwindow* window); - diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 6f8aa978..e2034183 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -983,6 +983,15 @@ GLFWbool _glfwCreateWindowCocoa(_GLFWwindow* window, } // autoreleasepool } +GLFWbool _glfwAttachWindowCocoa(_GLFWwindow* window, + intptr_t native, + const _GLFWwndconfig* wndconfig, + const _GLFWctxconfig* ctxconfig, + const _GLFWfbconfig* fbconfig) { + _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa window attachment is not implemented"); + return GLFW_FALSE; +} + void _glfwDestroyWindowCocoa(_GLFWwindow* window) { @autoreleasepool { @@ -2050,4 +2059,3 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle) } #endif // _GLFW_COCOA - diff --git a/src/win32_init.c b/src/win32_init.c index ef2615f1..17766077 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -635,6 +635,7 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform) _glfwGetGammaRampWin32, _glfwSetGammaRampWin32, _glfwCreateWindowWin32, + _glfwAttachWindowWin32, _glfwDestroyWindowWin32, _glfwSetWindowTitleWin32, _glfwSetWindowIconWin32, @@ -728,4 +729,3 @@ void _glfwTerminateWin32(void) } #endif // _GLFW_WIN32 - diff --git a/src/win32_platform.h b/src/win32_platform.h index 82b34bb9..a0b2b041 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -540,6 +540,7 @@ void _glfwRestoreVideoModeWin32(_GLFWmonitor* monitor); void _glfwGetHMONITORContentScaleWin32(HMONITOR handle, float* xscale, float* yscale); GLFWbool _glfwCreateWindowWin32(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); +GLFWbool _glfwAttachWindowWin32(_GLFWwindow* window, intptr_t native, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); void _glfwDestroyWindowWin32(_GLFWwindow* window); void _glfwSetWindowTitleWin32(_GLFWwindow* window, const char* title); void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* images); @@ -621,4 +622,3 @@ void _glfwTerminateWGL(void); GLFWbool _glfwCreateContextWGL(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); - diff --git a/src/win32_window.c b/src/win32_window.c index 676640bf..2e7652e8 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1501,6 +1501,11 @@ GLFWbool _glfwCreateWindowWin32(_GLFWwindow* window, return GLFW_TRUE; } +GLFWbool _glfwAttachWindowWin32(_GLFWwindow* window, intptr_t native, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { + _glfwInputError(GLFW_PLATFORM_ERROR, "Win32 window attachment is not implemented"); + return GLFW_FALSE; +} + void _glfwDestroyWindowWin32(_GLFWwindow* window) { if (window->monitor) @@ -2501,4 +2506,3 @@ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* handle) } #endif // _GLFW_WIN32 -