fix CAMetalLayers

This commit is contained in:
Greg Wells
2025-06-01 20:39:49 -04:00
parent 964ac7127d
commit 5b9f0d8ebe
22 changed files with 161 additions and 117 deletions

View File

@@ -14,10 +14,15 @@
#error "Must define GLFW_EXPOSE_NATIVE_COCOA on macos"
#endif
gnReturnCode gnCreateGLFWWindowSurface(struct gnWindowSurface_t* windowSurface, struct gnInstance_t* instance, GLFWwindow* window) {
static gnReturnCode gnCreateGLFWWindowSurface(struct gnWindowSurface_t* windowSurface, struct gnInstance_t* instance, GLFWwindow* window) {
MTKView* view = gnCreateMTKView(glfwGetCocoaWindow(window));
gnWindowSetMTKView(glfwGetCocoaWindow(window), view);
CAMetalLayer* layer = gnGetCAMetalLayer(glfwGetCocoaWindow(window));
gnMacOSWindowSurfaceInfo surfaceCreateInfo = {
.window = (NSWindow*)glfwGetCocoaWindow(window)
.layer = layer
};
return gnCreateMacOSWindowSurface(windowSurface, instance, surfaceCreateInfo);
}