]> git.tdb.fi Git - libs/gl.git/blob - source/shadowmap.h
Add Vector3 and Vector4 classes
[libs/gl.git] / source / shadowmap.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef SHADOWMAP_H_
9 #define SHADOWMAP_H_
10
11 #include "effect.h"
12 #include "framebuffer.h"
13 #include "texture2d.h"
14 #include "vector.h"
15
16 namespace Msp {
17 namespace GL {
18
19 class Light;
20 class Scene;
21
22 class ShadowMap: public Effect
23 {
24 private:
25         unsigned size;
26         const Scene &scene;
27         const Light &light;
28         Framebuffer fbo;
29 public:
30         Texture2D depth_buf;
31 private:
32         Vector3 target;
33         float radius;
34
35 public:
36         ShadowMap(unsigned, const Scene &, const Light &);
37         void set_target(const Vector3 &, float);
38         virtual void prepare();
39         virtual void cleanup();
40 };
41
42 } // namespace GL
43 } // namespace Msp
44
45 #endif