Skip to content

fix: Fix macOS not displaying rendered Vulkan surface#2

Open
JNightRider wants to merge 1 commit into
jMonkeyEngine:masterfrom
JNightRider:fix/displaying-macos
Open

fix: Fix macOS not displaying rendered Vulkan surface#2
JNightRider wants to merge 1 commit into
jMonkeyEngine:masterfrom
JNightRider:fix/displaying-macos

Conversation

@JNightRider

Copy link
Copy Markdown

This pull request introduces some changes regarding the MacOS platform (this was introduced in lwjg3-awt in this PR).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the macOS AWT canvas implementations for both OpenGL and Vulkan. For OpenGL, it updates the createNSOpenGLView method to correctly initialize NSOpenGLView instances and introduces an intermediate CALayer for better layer management. For Vulkan, the createMTKView method is significantly refactored to use dedicated helper methods for LibFFI calls, improving clarity and robustness, and also incorporates an intermediate CALayer and ensures UI updates are performed on the main thread. Review comments indicate a critical issue in PlatformMacOSXGLCanvas.java where setWantsLayer: and layer were incorrectly called on an uninitialized nsOpenGLView object instead of the properly initialized view object, which could lead to crashes.

Comment thread src/org/lwjgl/opengl/awt/PlatformMacOSXGLCanvas.java
Comment thread src/org/lwjgl/opengl/awt/PlatformMacOSXGLCanvas.java
@JNightRider

JNightRider commented Apr 9, 2026

Copy link
Copy Markdown
Author

I'm not entirely sure about the assistant, as I can't test these changes on a macOS computer (I want to make these changes to sync this platform: macOS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant