Repository navigation
Fix missing native_window::get_dims() override on macOS - #45
Merged
Merged
Conversation
The base native_window::get_dims() returns {0, 0}. The macOS
native_window never overrode it, so the OpenGL renderer computed
the viewport y-offset as (0 - 0 - height), placing the viewport
entirely off-screen. As a result, all drawing was clipped away
and the window rendered black.
Implement get_dims() to return the current window dimensions in
physical pixels (points scaled by the backing scale factor),
matching the behavior of the other platforms.
igagis
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
native_window::get_dims()returned{0, 0}because the macOS native window never overrode it.get_dims()to convert top-left origin viewports to OpenGL's bottom-left origin (effective_target_height()), so the viewport y-offset came out as-(height), placing the viewport entirely off-screen and rendering black.get_dims()returning physical pixels (points * backing scale factor), matching other platforms (iOS, SDL, etc.).Testing
hello-world-openglandruisapp-opengl-testnow render their windows correctly on macOS (previously black).ruis-testspass (353/353).