Function

CoglTexturenew_from_file

deprecated: 1.18 since: 0.8

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

Type: 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

Type: CoglTextureFlags

Optional flags for the texture, or COGL_TEXTURE_NONE.

internal_format

Type: 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

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: 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.