Esempio n. 1
0
CoglBitmap *
cogl_bitmap_new_from_file (CoglContext *ctx,
                           const char *filename,
                           CoglError **error)
{
  _COGL_RETURN_VAL_IF_FAIL (filename != NULL, NULL);
  _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);

  return _cogl_bitmap_from_file (ctx, filename, error);
}
Esempio n. 2
0
CoglTexture2D *
cogl_texture_2d_new_from_file (CoglContext *ctx,
                               const char *filename,
                               CoglError **error)
{
  CoglBitmap *bmp;
  CoglTexture2D *tex_2d = NULL;

  _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);

  bmp = _cogl_bitmap_from_file (ctx, filename, error);
  if (bmp == NULL)
    return NULL;

  tex_2d = _cogl_texture_2d_new_from_bitmap (bmp,
                                             TRUE); /* can convert in-place */

  cogl_object_unref (bmp);

  return tex_2d;
}