diff options
Diffstat (limited to 'common/cogl-material.c')
-rw-r--r-- | common/cogl-material.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/common/cogl-material.c b/common/cogl-material.c index 498c8597..c456cac6 100644 --- a/common/cogl-material.c +++ b/common/cogl-material.c @@ -1,3 +1,28 @@ +/* + * Cogl + * + * An object oriented GL/GLES Abstraction/Utility Layer + * + * Copyright (C) 2008,2009 Intel Corporation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: + * Robert Bragg <robert@linux.intel.com> + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -169,6 +194,18 @@ cogl_material_set_color4ub (CoglHandle handle, } void +cogl_material_set_color4f (CoglHandle handle, + float red, + float green, + float blue, + float alpha) +{ + CoglColor color; + cogl_color_set_from_4f (&color, red, green, blue, alpha); + cogl_material_set_color (handle, &color); +} + +void cogl_material_get_ambient (CoglHandle handle, CoglColor *ambient) { @@ -619,7 +656,8 @@ cogl_material_set_layer_matrix (CoglHandle material_handle, static void _cogl_material_layer_free (CoglMaterialLayer *layer) { - cogl_handle_unref (layer->texture); + if (layer->texture != COGL_INVALID_HANDLE) + cogl_handle_unref (layer->texture); g_free (layer); } |