Cogl.Onscreen.prototype.swap_region
function swap_region(rectangles: Number(gint), n_rectangles: Number(gint)): void { // Gjs wrapper for cogl_onscreen_swap_region() }
Swaps a region of the back buffer being rendered too, to the front for display. rectangles represents the region as array of n_rectangles each defined by 4 sequential (x, y, width, height) integers.
This function also implicitly discards the contents of the color, depth and stencil buffers as if Cogl.Framebuffer.prototype.discard_buffers were used. The significance of the discard is that you should not expect to be able to start a new frame that incrementally builds on the contents of the previous frame.
Since 1.10
- rectangles
An array of integer 4-tuples representing rectangles as (x, y, width, height) tuples.
- n_rectangles
The number of 4-tuples to be read from rectangles