Cogl.Texture2D.new_with_size
Description: Reference for Cogl.Texture2D.new_with_size

### Constructor

# Cogl Texture2Dnew_with_size

#### Declaration [src]

    CoglTexture*
    cogl_texture_2d_new_with_size (
      CoglContext* ctx,
      int width,
      int height
    )

#### Description [src]

Creates a low-level `CoglTexture2D` texture with a given `width` and `height` that your GPU can texture from directly.

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().

#### Parameters

`ctx`

  Type: `CoglContext`

  A `CoglContext`.

  The data is owned by the caller of the function.

`width`

  Type: `int`

  Width of the texture to allocate.

`height`

  Type: `int`

  Height of the texture to allocate.

#### Return value

Type: `CoglTexture`

A new `CoglTexture2D` object with no storage yet allocated.

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