Skip to content

sapp: Add window position and screen size APIs#1416

Draft
squk wants to merge 1 commit into
floooh:masterfrom
squk:window_pos_screen_size
Draft

sapp: Add window position and screen size APIs#1416
squk wants to merge 1 commit into
floooh:masterfrom
squk:window_pos_screen_size

Conversation

@squk

@squk squk commented Jan 18, 2026

Copy link
Copy Markdown

EDIT: Checkout https://github.com/squk/sokol_utils

  • Added sapp_set_window_position() to set the window top-left position.
  • Added sapp_screen_width() and sapp_screen_height() to query screen dimensions.
  • Win32 implementation uses MonitorFromWindow to return dimensions of the current monitor.

:)

- Added sapp_set_window_position() to set the window top-left position.
- Added sapp_screen_width() and sapp_screen_height() to query screen dimensions.
- Win32 implementation uses MonitorFromWindow to return dimensions of the current monitor.
@floooh

floooh commented Jan 18, 2026

Copy link
Copy Markdown
Owner

Thanks for the effort, I'll keep the PR open for other to use, but will not merge it into the main version. There will eventually be more control over window positioning, but it will likely be implemented alongside multiwindow support (which is more straightforward now with the re-designed sokol begin/end-pass functions.

Another way to add missing functionality like this is to either create an 'extension header' which is included after the sokol_app.h implementation (and thus has access to private sokol_app.h functions and state), or create a separate library or helper functions which use the platform specific window handles (e.g. sapp_win32_get_hwnd() etc...).

@floooh floooh marked this pull request as draft January 18, 2026 17:53
@squk

squk commented Jan 18, 2026

Copy link
Copy Markdown
Author

Thanks for taking a look and the advice!

@squk

squk commented Jan 29, 2026

Copy link
Copy Markdown
Author

I created a repo to house my extensions : https://github.com/squk/sokol_utils

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