gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.67k stars 926 forks source link

Currently, it seems that `wgpu` doesn't have a function to not enlarge/reduce the contents when resizing the window. #6158

Closed rustbasic closed 2 months ago

rustbasic commented 2 months ago

Currently, it seems that wgpu doesn't have a function to not enlarge/reduce the contents when resizing the window.

In GUIs that use wgpu, you may not want the contents to zoom in/out when resizing the window.

If I'm wrong or there's a way, please let me know.

wgpu: 22.1.0 OS: Windows10

cwfitzgerald commented 2 months ago

Hello! This is expected to be handled by the user in their shader, generally by using projection matrixes which scale vertices appropriately. If you haven't, I would highly recommend taking a look learn-wgpu or webgpu fundamentals, as this should go over how graphics apis expect things like scaling to work.