Function

Coglblit_framebuffer

Declaration [src]

gboolean
cogl_blit_framebuffer (
  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

framebuffer CoglFramebuffer
 

The source CoglFramebuffer.

 The data is owned by the caller of the function.
dst CoglFramebuffer
 

The destination CoglFramebuffer.

 The data is owned by the caller of the function.
src_x int
 

Source x position.

src_y int
 

Source y position.

dst_x int
 

Destination x position.

dst_y int
 

Destination y position.

width int
 

Width of region to copy.

height int
 

Height of region to copy.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
  No description available.