]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/light.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / materials / light.h
index 606ec67325812d535d305c5756ca82bcfb439528..189380cdb7a1e2f1b619423761b708bfadc8b2dc 100644 (file)
@@ -19,7 +19,7 @@ implement different types of lights.
 Lights are usually grouped with a Lighting object, which can be used in a
 Sequence::Step.
 
-Lights do not cast shadows by themselves.  See ShadowMap for that.
+Shadows can be added to lights by using the ShadowMap effect.
 */
 class Light: public Placeable
 {
@@ -48,21 +48,22 @@ public:
        };
 
 protected:
-       Color color;
-       unsigned generation;
+       Color color = { 1.0f };
+       unsigned generation = 0;
 
+       Light() = default;
 public:
-       Light();
+       virtual ~Light() = default;
 
-       /** Sets the color of the Light. */
+       /** Sets the color of the light. */
        void set_color(const Color &);
 
        const Color &get_color() const { return color; }
 
        unsigned get_generation() const { return generation; }
 
-       /** Updates a ProgramData object with the uniforms for the Light.  A light
-       source index must be passed in.  Primarily used by Lighting. */
+       /** Updates a ProgramData object with the uniform values for the light.  A
+       light source index must be passed in. */
        void update_shader_data(ProgramData &, unsigned) const;
 
 protected: