core: ability to get screen size #1014
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#1014
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
github.com/hexops/mach-core@9243a331a3/src/main.zig (L107)I think this is a pretty good default window size except it doesn't work for all screen sizes if it's supposed to. I would like to query the resolution of the monitor that the Mach window is active on. This way the size could be made to be half the actual screen size. Similar to
core.size()it could be queried ascore.screenSize(). Of course, there are other reasons why a user might want to query the screen size. This is a proposal to add such a function.Setting the screen size is almost certainly not possible by a regular process. I do have this option in my system settings though:
For the implementation
glfwGetVideoMode(https://www.glfw.org/docs/3.0/group__monitor.html#gac3fe0f647f68b731f99756cd81897378) is probably relevant. I don't see a callback that fires when the screen size changes (like when I use my system settings above to change the monitor resolution) unless I'm missing something?glfwGetVideoMode(https://www.glfw.org/docs/latest/group__monitor.html#gaba376fa7e76634b4788bddc505d6c9d5) only seems to fire when a monitor is connected or disconnected rather than when its size changes.If there is such a callback it might be better for mach-core to keep track of the screen size internally and then change that value when the callback is called? And then
core.screenSize()won't actually call into GLFW.Related #1102