Cogl.Texture.new_from_file
Description: Reference for Cogl.Texture.new_from_file

### Function

# Cogl Texturenew_from_file

#### Declaration [src]

    CoglTexture*
    cogl_texture_new_from_file (
      const char* filename,
      CoglTextureFlags flags,
      CoglPixelFormat internal_format,
      GError** error
    )

#### Description [src]

Creates a `CoglTexture` from an image file.

Available since: | 0.8
Deprecated since: | 1.18
Use specific constructors such as `cogl_texture_2d_new_from_file()`

#### Parameters

`filename` | `const char*`
| The file to load.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`flags` | `CoglTextureFlags`
| Optional flags for the texture, or `COGL_TEXTURE_NONE`.
`internal_format` | `CoglPixelFormat`
| The `CoglPixelFormat` to use for the GPU storage of the texture. If `COGL_PIXEL_FORMAT_ANY` is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `CoglTexture`
| A newly created `CoglTexture` or `NULL` on failure.
| The caller of the function takes ownership of the data, and is responsible for freeing it.