The host window was resized (framebuffer pixels), and pixel_ratio: its
framebuffer pixels per window unit (Qt's devicePixelRatio), if it may
have changed (the window moved to a screen of another scale, or the
display's scaling changed: sizes in window units, such as line widths,
markers and labels, are scaled by it). Once the scene is shown, a frame
of the new size is rendered at once (call this from the host's resize
event), so that the window isn't shown stretched or blank while it is
resized.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | width |
framebuffer pixels |
||
| integer, | intent(in) | :: | height |
framebuffer pixels |
||
| real(kind=wp), | intent(in), | optional | :: | pixel_ratio |
framebuffer pixels per window unit |
subroutine resize(self, width, height, pixel_ratio) class(WindowProxy), intent(inout) :: self integer, intent(in) :: width, height !! framebuffer pixels real(wp), intent(in), optional :: pixel_ratio !! framebuffer pixels per window unit if (.not. c_associated(self%viewer_)) return if (present(pixel_ratio)) then if (pixel_ratio > 0.0_wp .and. pixel_ratio /= self%pixel_ratio_) then self%pixel_ratio_ = pixel_ratio if (vkf_viewer_set_pixel_ratio(self%viewer_, real(pixel_ratio, c_double)) /= 0) & write(*, '(a)') 'vkframes: could not set the pixel ratio' end if end if self%width_ = max(1, width) self%height_ = max(1, height) if (vkf_viewer_resize(self%viewer_, int(width, c_int), int(height, c_int)) /= 0) & write(*, '(a)') 'vkframes: resize failed' ! a frame of the new size at once (once the scene is shown), so the window ! isn't shown stretched or blank while being resized if (self%scene_added) then if (self%frame()) continue end if end subroutine resize