You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
890 B

5 years ago
  1. #pragma once
  2. #include "ggl.h"
  3. class Light {
  4. protected:
  5. GLenum mLightIdentifier;
  6. Light();
  7. public:
  8. void SetAmbientColor(float r, float g, float b, float a);
  9. void SetDiffuseColor(float r, float g, float b, float a);
  10. void SetSpecularColor(float r, float g, float b, float a);
  11. void Enable();
  12. };
  13. class DirectionLight : public Light {
  14. public:
  15. DirectionLight(GLenum light);
  16. void SetPosition(float x, float y, float z);
  17. };
  18. class PointLight : public Light {
  19. float mPosition[3];
  20. public:
  21. PointLight(GLenum light);
  22. void SetPosition(float x, float y, float z);
  23. void SetConstAttenuation(float v);
  24. void SetLinearAttenuation(float v);
  25. void SetQuadricAttenuation(float v);
  26. void Update(float x, float y, float z);
  27. };
  28. class SpotLight : public PointLight {
  29. public:
  30. SpotLight(GLenum light);
  31. void SetDirection(float x, float y, float z);
  32. void SetExpone(float v);
  33. void SetCutoff(float v);
  34. };