dungeon_crawler
diff prototype/src/light.h @ 23:fa8f89d06f6f
progress with light rendering
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 23 Aug 2012 00:10:10 +0300 |
parents | 0588f8a1a351 |
children | 862461b686f4 |
line diff
1.1 --- a/prototype/src/light.h Tue Aug 21 06:34:14 2012 +0300 1.2 +++ b/prototype/src/light.h Thu Aug 23 00:10:10 2012 +0300 1.3 @@ -8,6 +8,12 @@ 1.4 float intensity; 1.5 Color color; 1.6 1.7 + // VBO for rendering the light source 1.8 + unsigned int vbo; 1.9 + unsigned int num_faces; 1.10 + 1.11 + virtual bool create_mesh(); 1.12 + 1.13 public: 1.14 Light(const Color &col = 1.0); 1.15 virtual ~Light(); 1.16 @@ -18,6 +24,8 @@ 1.17 virtual Color get_color(bool with_intensity = true) const; 1.18 1.19 virtual void use(int id = 0) const; 1.20 + 1.21 + virtual void draw() const; 1.22 }; 1.23 1.24 class PointLight : public Light { 1.25 @@ -26,6 +34,8 @@ 1.26 float atten[3]; 1.27 float radius; 1.28 1.29 + bool create_mesh(); 1.30 + 1.31 public: 1.32 PointLight(); 1.33 PointLight(const Vector3 &pos, const Color &col = 1.0); 1.34 @@ -37,12 +47,16 @@ 1.35 float get_radius() const; 1.36 1.37 virtual void use(int id = 0) const; 1.38 + 1.39 + virtual void draw() const; 1.40 }; 1.41 1.42 class DirLight : public Light { 1.43 protected: 1.44 Vector3 dir; 1.45 1.46 + bool create_mesh(); 1.47 + 1.48 public: 1.49 DirLight(); 1.50 DirLight(const Vector3 &dir, const Color &col = 1.0);