next up previous contents index
Next: The attribute Function Up: GraphicDevice Previous: Texturing

Lightsource Handling

int generate_lightsource (int type)
  /* types */
  G_LIGHT_AMBIENT
  G_LIGHT_DIRECT
  G_LIGHT_POINT
  G_LIGHT_SPOT
This defines a new light source. The available types are device dependent. If no light source of the desired type is available the return code is zero. The different types are

tabular33199

Not all types are supplied by all machines. Since no more attributes are available for the light sources they are switched off.

   /* modes */
   G_MODE_GET
   G_MODE_SET

typedef struct lightsource_dev {
    int type;            /* G_LIGHT_AMBIENT | DIRECT | POINT | SPOT */
    int on_off;          /* lightsource switched ON or OFF */
    double color[3];     /* rgb light color (incl. intensity) */
    double position[3];  /* POINT | SPOT light source position */
    double direction[3]; /* DIRECT | SPOT light direction */
    double open_angle;   /* SPOT open angle */
} LIGHTSOURCE_DEV;

void lightsource (int mode, int light, LIGHTSOURCE_DEV *data)
Read or modify any light source. The light's number light has to be returned by a previous dev->generate_lightsource(). A light source is maintained by its data but its type can not be changed by G_MODE_SET. It has been defined by dev->generate_lightsource().

void delete_lightsource (int light)
This removes the given light source light previously defined by dev->generate_lightsource().



SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.