## material

material — Material generation and manipulation

## Functions

G3DMaterial * | g3d_material_new ()
void | g3d_material_free ()

## Types and Values

| G3DMaterial

## Includes

    #include <g3d/material.h>

## Description

A material contains all color, shading and texture information for a G3DFace.

## Functions

### g3d_material_new ()

    G3DMaterial *
    g3d_material_new (void);

Generates a new material with a default color.

#### Returns

the new material or NULL on error

### g3d_material_free ()

    void
    g3d_material_free (G3DMaterial *material);

Frees all memory allocated for that material.

#### Parameters

material | the material to free |

## Types and Values

### G3DMaterial

    typedef struct {
    	gchar *name;
    	G3DFloat r, g, b, a;
    	G3DFloat shininess;
    	G3DFloat specular[4];
    	guint32 flags;

    	G3DImage *tex_image;
    } G3DMaterial;

A material object.

#### Members

gchar *`name`; | name of material |
G3DFloat `r`; | red component of color |
G3DFloat `g`; | green component of color |
G3DFloat `b`; | blue component of color |
G3DFloat `a`; | alpha component of color |
G3DFloat `shininess`; | shiny color |
G3DFloat `specular`[4]; | specular color |
guint32 `flags`; | flags |
G3DImage *`tex_image`; | texture image (optional, may be NULL) |