Skip to content

glue: pass content rect through to set_viewport; override get_dims on Android/iOS/Windows - #43

Closed
igagis-bot wants to merge 2 commits into
cppfw:mainfrom
igagis-bot:top-left-origin-glue
Closed

igagis-bot wants to merge 2 commits into
cppfw:mainfrom
igagis-bot:top-left-origin-glue

Conversation

@igagis-bot

Copy link
Copy Markdown
Contributor

Summary

Part of the top-left origin window coordinate work (ruis PR #205, ruis-render-opengl PR #7, ruis-render-opengles PR #8).

  • The Android glue no longer flips the content rect's Y before passing it to gui::set_viewport() — the framework now talks top-left origin window coordinates (x right, y down) end to end.
  • The Android, iOS and Windows glue override get_dims() (const noexcept) to return the real physical-pixel window dimensions — the base class default is {0, 0}. The OpenGL renderers use this to convert scissor/viewport rects between the framework's top-left origin convention and the renderers' bottom-left origin (the viewport's bottom-left equivalent is (x, total_height - y - h)).

The Windows override is what the OpenGL test app uses; iOS/Android cannot be built or run on this machine — please review by eye.

… Android/iOS/Windows

The framework's window coordinates are now top-left origin (x right, y down),
so the Android glue no longer flips the content rect before handing it to
gui::set_viewport(). The Android/iOS/Windows glue overrides get_dims() to
return real physical-pixel window dimensions (the base class default is
{0, 0}); the OpenGL renderers use this to convert scissor/viewport rects
between the framework's top-left origin convention and the renderers'
bottom-left origin.
@igagis-bot

Copy link
Copy Markdown
Contributor Author

Superseded by #42: the glue changes (content rect passthrough to set_viewport, get_dims overrides on Android/iOS/Windows) are now part of the DirectX 12 variant PR (merged into its directx-variant branch).

@igagis-bot igagis-bot closed this Nov 30, 2026
igagis-bot pushed a commit to igagis-bot/ruisapp that referenced this pull request Dec 2, 2026
- The application factory creates the ruis::render::directx::context from
  the window handle
- Declares the ruisapp-directx library and the ruisapp-directx-test application
- Windows-only; the published vcpkg port does not ship ruis-render-directx
  deps yet — the port's test manifest includes ruis-render-directx so the
  test variant builds
- Merged in the glue changes from the (now closed) cppfw#43: set_win_rect()
  passes the content rect straight through to set_viewport() (top-left
  origin window coordinates), the Android/iOS/Windows glue gains a
  get_dims() override (Android: from the EGL surface; iOS: window frame x
  scale; Windows: GetClientRect), and the EGL surface wrapper reports its
  dims as const.
igagis added a commit that referenced this pull request Dec 2, 2026
- The application factory creates the ruis::render::directx::context from
  the window handle
- Declares the ruisapp-directx library and the ruisapp-directx-test application
- Windows-only; the published vcpkg port does not ship ruis-render-directx
  deps yet — the port's test manifest includes ruis-render-directx so the
  test variant builds
- Merged in the glue changes from the (now closed) #43: set_win_rect()
  passes the content rect straight through to set_viewport() (top-left
  origin window coordinates), the Android/iOS/Windows glue gains a
  get_dims() override (Android: from the EGL surface; iOS: window frame x
  scale; Windows: GetClientRect), and the EGL surface wrapper reports its
  dims as const.
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