Cogl.Texture2D.new_from_bitmap
Description: Reference for Cogl.Texture2D.new_from_bitmap

### Constructor

# Cogl Texture2Dnew_from_bitmap

since: 2.0

#### Declaration [src]

    CoglTexture2D*
    cogl_texture_2d_new_from_bitmap (
      CoglBitmap* bitmap
    )

#### Description [src]

Creates a low-level `CoglTexture2D` texture based on data residing in a `CoglBitmap`.

The storage for the texture is not allocated before this function returns. You can call `cogl_texture_allocate()` to explicitly allocate the underlying storage or preferably let Cogl automatically allocate storage lazily when it may know more about how the texture is being used and can optimize how it is allocated.

The texture is still configurable until it has been allocated so for example you can influence the internal format of the texture using `cogl_texture_set_components()` and cogl_texture_set_premultiplied().

Stability: Unstable

Available since: 2.0

#### Parameters

`bitmap`

  Type: `CoglBitmap`

  A `CoglBitmap`.

  The data is owned by the caller of the function.

#### Return value

Type: `CoglTexture2D`

A newly allocated `CoglTexture2D`.

The caller of the function takes ownership of the data, and is responsible for freeing it.