Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

material.h

Go to the documentation of this file.
00001 /*********************************************************************
00002 * lescegra                                                           *
00003 *                                                                    *
00004 * http://geeky.kicks-ass.org/projects/lescegra.html                  *
00005 *                                                                    *
00006 * Copyright 2003 by Enno Cramer <uebergeek@web.de>                   *
00007 *                                                                    *
00008 * This library is free software; you can redistribute it and/or      *
00009 * modify it under the terms of the GNU Library General Public        *
00010 * License as published by the Free Software Foundation; either       *
00011 * version 2 of the License, or (at your option) any later version.   *
00012 *                                                                    *
00013 * This library is distributed in the hope that it will be useful,    *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  *
00016 * Library General Public License for more details.                   *
00017 *                                                                    *
00018 * You should have received a copy of the GNU Library General Public  *
00019 * License along with this library; if not, write to the Free         *
00020 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
00021 *********************************************************************/
00022 
00023 #ifndef LSG_MATERIAL_H
00024 #define LSG_MATERIAL_H 1
00025 
00026 /**
00027  * \file  material.h
00028  * \brief Material properties
00029  */
00030 
00031 #include <lescegra/sg/group.h>
00032 
00033 /**
00034  * \ingroup scene
00035  * \brief   Material properties
00036  *
00037  * Apply material properties to all children.
00038  */
00039 typedef struct {
00040     LsgGroup super;
00041     float ambient[4];
00042     float diffuse[4];
00043     float specular[4];
00044     float shininess;
00045 } LsgMaterial;
00046 
00047 /**
00048  * Allocate and initialize a material node.
00049  * @return A new material node
00050  */
00051 LsgMaterial* LsgMaterial_create(void);
00052 
00053 /**
00054  * Constructor method for LsgMaterial. Create a new material node with default
00055  * color values.
00056  * @param self      The instance variable
00057  */
00058 void LsgMaterial_init(LsgMaterial* self);
00059 
00060 /**
00061  * Set material properties and display all children.
00062  * @param self      The instance variable
00063  * @param frustum   The view frustum
00064  */
00065 void LsgMaterial_display(LsgMaterial* self, LsgFrustum* frustum);
00066 
00067 #define LsgMaterial_clean(self)         LsgGroup_clean(&(self)->super)
00068 #define LsgMaterial_update(self, now)   LsgGroup_update(&(self)->super, now)
00069 #define LsgMaterial_collide(self, v, n) LsgGroup_collide(&(self)->super, v, n)
00070 
00071 #endif

(c) 2003, by Enno Cramer
generated on 9 Jul 2003
lescegra - doxygen