## X11 Texture From Pixmap X11 Texture From Pixmap — Functions for creating and manipulating 2D meta textures derived from X11 pixmaps. |

## Synopsis

                        CoglTexturePixmapX11;
    CoglBool            cogl_is_texture_pixmap_x11          (void *object);

    CoglTexturePixmapX11 * cogl_texture_pixmap_x11_new      (CoglContext *context,
                                                             uint32_t pixmap,
                                                             CoglBool automatic_updates,
                                                             CoglError **error);

    void                cogl_texture_pixmap_x11_update_area (CoglTexturePixmapX11 *texture,
                                                             int x,
                                                             int y,
                                                             int width,
                                                             int height);
    CoglBool            cogl_texture_pixmap_x11_is_using_tfp_extension
                                                            (CoglTexturePixmapX11 *texture);
    enum                CoglTexturePixmapX11ReportLevel;
    void                cogl_texture_pixmap_x11_set_damage_object
                                                            (CoglTexturePixmapX11 *texture,
                                                             uint32_t damage,
                                                             CoglTexturePixmapX11ReportLevel report_level);

## Description

These functions allow high-level meta textures (See the CoglMetaTexture interface) that derive their contents from an X11 pixmap.

## Details

### CoglTexturePixmapX11

    typedef struct _CoglTexturePixmapX11 CoglTexturePixmapX11;

### cogl_is_texture_pixmap_x11 ()

    CoglBool            cogl_is_texture_pixmap_x11          (void *object);

Checks whether `object` points to a CoglTexturePixmapX11 instance.

`object` : | A pointer to a CoglObject
Returns : | `TRUE` if the object is a CoglTexturePixmapX11, and `FALSE` otherwise

Since 1.4

Stability Level: Unstable

### cogl_texture_pixmap_x11_new ()

    CoglTexturePixmapX11 * cogl_texture_pixmap_x11_new      (CoglContext *context,
                                                             uint32_t pixmap,
                                                             CoglBool automatic_updates,
                                                             CoglError **error);

Creates a texture that contains the contents of `pixmap`. If `automatic_updates` is `TRUE` then Cogl will attempt to listen for damage events on the pixmap and automatically update the texture when it changes.

`context` : | A CoglContext
`pixmap` : | A X11 pixmap ID
`automatic_updates` : | Whether to automatically copy the contents of the pixmap to the texture.
`error` : | A CoglError for exceptions
Returns : | a new CoglTexturePixmapX11 instance

Since 1.10

Stability Level: Unstable

### cogl_texture_pixmap_x11_update_area ()

    void                cogl_texture_pixmap_x11_update_area (CoglTexturePixmapX11 *texture,
                                                             int x,
                                                             int y,
                                                             int width,
                                                             int height);

Forces an update of the given `texture` so that it is refreshed with the contents of the pixmap that was given to `cogl_texture_pixmap_x11_new()`.

`texture` : | A CoglTexturePixmapX11 instance
`x` : | x coordinate of the area to update
`y` : | y coordinate of the area to update
`width` : | width of the area to update
`height` : | height of the area to update

Since 1.4

Stability Level: Unstable

### cogl_texture_pixmap_x11_is_using_tfp_extension ()

    CoglBool            cogl_texture_pixmap_x11_is_using_tfp_extension
                                                            (CoglTexturePixmapX11 *texture);

Checks whether the given `texture` is using the GLX_EXT_texture_from_pixmap or similar extension to copy the contents of the pixmap to the texture. This extension is usually implemented as zero-copy operation so it implies the updates are working efficiently.

`texture` : | A CoglTexturePixmapX11 instance
Returns : | `TRUE` if the texture is using an efficient extension and `FALSE` otherwise

Since 1.4

Stability Level: Unstable

### enum CoglTexturePixmapX11ReportLevel

    typedef enum {
      COGL_TEXTURE_PIXMAP_X11_DAMAGE_RAW_RECTANGLES,
      COGL_TEXTURE_PIXMAP_X11_DAMAGE_DELTA_RECTANGLES,
      COGL_TEXTURE_PIXMAP_X11_DAMAGE_BOUNDING_BOX,
      COGL_TEXTURE_PIXMAP_X11_DAMAGE_NON_EMPTY
    } CoglTexturePixmapX11ReportLevel;

`COGL_TEXTURE_PIXMAP_X11_DAMAGE_RAW_RECTANGLES` |
`COGL_TEXTURE_PIXMAP_X11_DAMAGE_DELTA_RECTANGLES` |
`COGL_TEXTURE_PIXMAP_X11_DAMAGE_BOUNDING_BOX` |
`COGL_TEXTURE_PIXMAP_X11_DAMAGE_NON_EMPTY` |

### cogl_texture_pixmap_x11_set_damage_object ()

    void                cogl_texture_pixmap_x11_set_damage_object
                                                            (CoglTexturePixmapX11 *texture,
                                                             uint32_t damage,
                                                             CoglTexturePixmapX11ReportLevel report_level);

Sets the damage object that will be used to track automatic updates to the `texture`. Damage tracking can be disabled by passing 0 for `damage`. Otherwise this damage will replace the one used if `TRUE` was passed for automatic_updates to `cogl_texture_pixmap_x11_new()`.

Note that Cogl will subtract from the damage region as it processes damage events.

`texture` : | A CoglTexturePixmapX11 instance
`damage` : | A X11 Damage object or 0
`report_level` : | The report level which describes how to interpret the damage events. This should match the level that the damage object was created with.

Since 1.4

Stability Level: Unstable