Cogl.PixelBuffer.new

function new(context: Cogl.Context, size: Number(gsize), data: void): Cogl.PixelBuffer {
    // Gjs wrapper for cogl_pixel_buffer_new()
}
  

Declares a new Cogl.PixelBuffer of size bytes to contain arrays of pixels. Once declared, data can be set using Cogl.buffer_set_data or by mapping it into the application's address space using Cogl.buffer_map.

If data isn't null then size bytes will be read from data and immediately copied into the new buffer.

Since 1.10

context

A Cogl.Context

size

The number of bytes to allocate for the pixel data.

data

An optional pointer to vertex data to upload immediately

Returns

a newly allocated Cogl.PixelBuffer