Open pnevyk opened 2 years ago
What works for me is using the size of the primary monitor with app.primary_monitor().unwrap().size()
. Interestingly, if I use .size(200, 200)
instead of .fullscreen()
, the app.window_rect()
is as expected.
So this issue is resolved for me and can be closed, but I wonder if this should be mentioned somewhere.
I am trying to run my app in fullscreen mode and at the same time get the dimensions of the fullscreen window to initialize wgpu::Texture in the
model
function. However, in themodel
I seem to get the default dimensions instead of the dimensions of the fullscreen window.Minimal example:
Both prints show values corresponding to 800x600 pixels, which is the size of the window if I don't use
fullscreen()
method.I checked the nannou code and at the moment of calling
model
function the window with fullscreen dimensions should already be available:https://github.com/nannou-org/nannou/blob/5d2620ecefdf3d8455531cfb0830aa2d25213ace/nannou/src/app.rs#L488-L498
but I didn't dive deeper and don't know anything about windowing and
winit
.How can I get the width and height of the fullscreen window in the
model
function?