Resizes the backbuffer of the given onscreen
framebuffer to the given size.
Since a buffer is usually conceptually scaled with a center point the offset_x
and offset_y
arguments allow
the newly allocated buffer to be positioned relative to the old buffer size.
For example a buffer that is being resized by moving the bottom right corner, and the top left corner is remaining static would use x and y offsets of (0, 0) since the top-left of the new buffer should have the same position as the old buffer. If the center of the old buffer is being zoomed into then all the corners of the new buffer move out from the center and the x and y offsets would be ( -half_x_size_increase, -half_y_size_increase) where x/y_size_increase is how many pixels bigger the buffer is on the x and y axis.
Note that if some drawing commands have been applied to the framebuffer since the last swap buffers then the resize will be queued and will only take effect in the next swap buffers.
If multiple calls to wayland_onscreen_resize get queued before the next swap buffers request then the
relative x and y offsets accumulate instead of being replaced. The width
and height
values superseed the old
values.
onscreen |
A Onscreen framebuffer |
width |
The desired width of the framebuffer |
height |
The desired height of the framebuffer |
offset_x |
A relative x offset for the new framebuffer |
offset_y |
A relative y offset for the new framebuffer |