Closed madsmtm closed 2 months ago
Does
winit
assume (for every backend) / guarantee that asurface
is "always" created with "some" initial size, and always delivers aResized
event afterwards if it changed? Or otherwise, if it doesn't know/understand/have an initial size, always raises aResized
event?
Hmm, isn't this more of a Softbuffer issue? We're creating the surface from the window, which itself has an initial size (the examples use with_inner_size
).
Hmm, isn't this more of a Softbuffer issue? We're creating the surface from the window, which itself has an initial size (the examples use
with_inner_size
).
It seems a bit surprising that creating a Softbuffer
surface doesn't require an initial size, as if it's able to query/follow that from the underlying window handle - but then we have to forward the size explicitly whenever a resize event occurs.
Otherwise that would have been a valid reason to not have size queries on the Surface
- the caller is always aware of the size already (and would reduce ambiguity).
Hmm, isn't this more of a Softbuffer issue? We're creating the surface from the window, which itself has an initial size (the examples use
with_inner_size
).It seems a bit surprising that creating a
Softbuffer
surface doesn't require an initial size, as if it's able to query/follow that from the underlying window handle - but then we have to forward the size explicitly whenever a resize event occurs.
Well, on macOS/iOS at least I think we could fairly easily make the surface follow the size of the window automatically, but I don't know about the other platforms.
Well, on macOS/iOS at least I think we could fairly easily make the surface follow the size of the window automatically, but I don't know about the other platforms.
Same on Android, by requesting a buffer size of 0
(or never setting one). I'll move the rest of the planned reply to https://github.com/rust-windowing/softbuffer/issues/237 and post it in a second!
The examples previously showed resizing just before rendering, which is inefficient, the user should only resize when needed. Tested on macOS.
I have not updated the
winit_multithread
example, as it was a bit more cumbersome, and I wouldn't be able to test it anyways, as it doesn't seem to work on macOS.