title: structs within classes?
body: <p>I have a class. I have made two seperate files, the header, and the c++ file. I am using it to create a more-or-less Light 'object' for an opengl game I am working on. Here are the files:
  Light.h</p>
  
  <pre><code>#ifndef LIGHT_H
  #define LIGHT_H
  
  
  class Light
  {
      public:
          Light(float ix, float iy, float iz, float ir, float ig, float ib , float ia, int itype, int iindex);
          virtual ~Light();
          float x,y,z;
          int index;
          int type;
          struct ambient
          {
              float r, g, b, a;
          };
          struct diffuse
          {
              float r, g, b, a;
          };
          struct specular
          {
             float r, g, b, a;
          };
      protected:
      private:
  };
  
  #endif // LIGHT_H
  </code></pre>
  
  <p>and, Light.cpp</p>
  
  <pre><code>#include "../include/Light.h"
  
  Light::Light(float ix, float iy, float iz, float ir, float ig, float ib , float ia, int itype, int iindex)
  {
      index=iindex;
      type=itype;
      x=ix;
      y=iy;
      z=iz;
      ambient.r = 0.2;
      ambient.g = 0.2;
      ambient.b = 0.2;
      ambient.a = 1.0;
      specular.r = 0.8;
      specular.g = 0.8;
      specular.b = 0.8;
      specular.a = 1.0;
      diffuse.r = ir;
      diffuse.g = ig;
      diffuse.b = ib;
      diffuse.a = ia;
  }
  
  Light::~Light()
  {
      //dtor
  }
  </code></pre>
  
  <p>When I try to compile, it throws an error saying:
  error: expected unqualified-id before ‘.’ token|
  For every line where I assign a value to a member of the structs (ambient, diffuse, specular)
  First off, I can't even interpret this error. No clue what it means. Secondly, I fail to see what I am doing wrong. Please help!</p>