Skip to content

Fix missing native_window::get_dims() override on macOS - #45

Merged
igagis merged 1 commit into
mainfrom
fix-macos-native-window-get-dims
Dec 2, 2026
Merged

igagis merged 1 commit into
mainfrom
fix-macos-native-window-get-dims

Conversation

@igagis-bot

Copy link
Copy Markdown
Contributor

Summary

  • native_window::get_dims() returned {0, 0} because the macOS native window never overrode it.
  • The OpenGL renderer uses 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.
  • Implement get_dims() returning physical pixels (points * backing scale factor), matching other platforms (iOS, SDL, etc.).

Testing

  • hello-world-opengl and ruisapp-opengl-test now render their windows correctly on macOS (previously black).
  • ruis-tests pass (353/353).

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
igagis merged commit d49a17f into main Dec 2, 2026
6 of 24 checks passed
@igagis
igagis deleted the fix-macos-native-window-get-dims branch December 2, 2026 19:42
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.

2 participants