]> git.tdb.fi Git - libs/gl.git/blob - source/lighting.h
76c241e9fa5c46e0ff6aefbcd17ef4dadfc81bdc
[libs/gl.git] / source / lighting.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2008  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_LIGHTING_H_
9 #define MSP_GL_LIGHTING_H_
10
11 #include <vector>
12 #include "bindable.h"
13 #include "color.h"
14 #include "gl.h"
15
16 namespace Msp {
17 namespace GL {
18
19 class Light;
20
21 /**
22 Encapsulates global lighting parameters and a number of individual lights.
23 */
24 class Lighting: public Bindable<Lighting>
25 {
26 private:
27         Color ambient;
28         std::vector<const Light *> lights;
29
30 public:
31         Lighting();
32
33         void set_ambient(const Color &);
34         const Color &get_ambient() const { return ambient; }
35
36         void attach(unsigned, const Light &);
37         void detach(unsigned);
38         void bind() const;
39
40         static void unbind();
41 };
42
43 } // namespace GL
44 } // namespace Msp
45
46 #endif