umlaeute / Gem

Graphics Environment for Multimedia (official repository)
https://gem.iem.at
Other
103 stars 29 forks source link

[gemglfw3window] default framebuffer size #390

Closed 60-hz closed 9 months ago

60-hz commented 9 months ago

When creating a new window under macos M1, the object return a big screen and "framebuffersize 2560 1832" by default rather than 500 500 under windows / linux.

This system inconsistency might be of the apple retina display.

umlaeute commented 9 months ago

that is pretty weird, as i'm sure i mostly use the default window size when testing on macOS (Ventura/arm64) and i think i would have noticed (it's not a Retina display however)

umlaeute commented 9 months ago

i've checked again, and now see:

on macOS (Ventura, and presumably yours as well), for whatever reasons, [gemglfw3window] ignores any window dimension set before creating the window (including the default size of 500x500) and instead uses the size of the last created window.

i'm not exactly sure where this comes from (either macOS being clever; or some problem with the context sharing; or some other GLFW issue (though i haven't found anything related bug report yet).

in any case, the code is trying to set the correct dimension when creating the window: https://github.com/umlaeute/Gem/blob/9664d6381156701d260058eb19813f4f4e472287/src/Output/gemglfw3window.cpp#L815-L818

umlaeute commented 9 months ago

ah i think i've found it:

we are doing https://github.com/umlaeute/Gem/blob/9664d6381156701d260058eb19813f4f4e472287/src/Output/gemglfw3window.cpp#L803

which, according to the docs:

[is the] name to use for autosaving the window frame

so the window information gets autosaved by macOS and our size hint gets ignored.