]> git.tdb.fi Git - libs/gl.git/blob - source/light.h
Bugfixes to Light
[libs/gl.git] / source / light.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_LIGHT_H_
9 #define MSP_GL_LIGHT_H_
10
11 #include "color.h"
12
13 namespace Msp {
14 namespace GL {
15
16 class Light
17 {
18 private:
19         Color ambient;
20         Color diffuse;
21         Color specular;
22         float x, y, z, w;
23         float sdx, sdy, sdz;
24         float spot_exp;
25         float spot_cutoff;
26         float attenuation[3];
27
28         static unsigned current;
29
30 public:
31         Light();
32         void set_ambient(const Color &c);
33         void set_diffuse(const Color &c);
34         void set_specular(const Color &c);
35         void set_position(float, float, float, float);
36         void apply() const;
37         void apply_to(unsigned) const;
38
39         static void activate(unsigned);
40 };
41
42 } // namespace GL
43 } // namespace Msp
44
45 #endif