Cogl.Framebuffer.blit

### Method

# Cogl Framebufferblit

#### Declaration [src]

    gboolean
    cogl_framebuffer_blit (
      CoglFramebuffer* framebuffer,
      CoglFramebuffer* dst,
      int src_x,
      int src_y,
      int dst_x,
      int dst_y,
      int width,
      int height,
      GError** error
    )

#### Description [src]

`return` FALSE for an immediately detected error, TRUE otherwise.

This blits a region of the color buffer of the source buffer to the destination buffer. This function should only be called if the COGL_FEATURE_ID_BLIT_FRAMEBUFFER feature is advertised.

The source and destination rectangles are defined in offscreen framebuffer orientation. When copying between an offscreen and onscreen framebuffers, the image is y-flipped accordingly.

The two buffers must have the same value types (e.g. floating-point, unsigned int, signed int, or fixed-point), but color formats do not need to match. This limitation comes from OpenGL ES 3.0 definition of glBlitFramebuffer.

Note that this function differs a lot from the glBlitFramebuffer function provided by the GL_EXT_framebuffer_blit extension. Notably it doesn’t support having different sizes for the source and destination rectangle. This doesn’t seem like a particularly useful feature. If the application wanted to scale the results it may make more sense to draw a primitive instead.

The GL function is documented to be affected by the scissor. This function therefore ensure that an empty clip stack is flushed before performing the blit which means the scissor is effectively ignored.

The function also doesn’t support specifying the buffers to copy and instead only the color buffer is copied. When copying the depth or stencil buffers the extension on GLES2.0 only supports copying the full buffer which would be awkward to document with this API. If we wanted to support that feature it may be better to have a separate function to copy the entire buffer for a given mask.

The `c` error argument is optional, it can be NULL. If it is not NULL and this function returns FALSE, an error object with a code from COGL_SYSTEM_ERROR will be created.

#### Parameters

`dst`

  Type: `CoglFramebuffer`

  The destination `CoglFramebuffer`.

  The data is owned by the caller of the method.

`src_x`

  Type: `int`

  Source x position.

`src_y`

  Type: `int`

  Source y position.

`dst_x`

  Type: `int`

  Destination x position.

`dst_y`

  Type: `int`

  Destination y position.

`width`

  Type: `int`

  Width of region to copy.

`height`

  Type: `int`

  Height of region to copy.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

No description available.