]> git.localhorst.tv Git - blobs.git/blobdiff - src/graphics/PlanetSurface.hpp
basic info box
[blobs.git] / src / graphics / PlanetSurface.hpp
index 2e73fbc1542e113a60eb95a1c0a6239011b06b28..178fcabac98123ad6914a8e01b45e9079f3cac4b 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "Program.hpp"
 
+#include "glm.hpp"
+
 
 namespace blobs {
 namespace graphics {
@@ -11,6 +13,9 @@ class ArrayTexture;
 
 class PlanetSurface {
 
+public:
+       static constexpr int MAX_LIGHTS = 8;
+
 public:
        PlanetSurface();
        ~PlanetSurface();
@@ -24,19 +29,40 @@ public:
 public:
        void Activate() noexcept;
 
+       void SetM(const glm::mat4 &m) noexcept;
+       void SetVP(const glm::mat4 &v, const glm::mat4 &p) noexcept;
        void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p) noexcept;
        void SetNormal(const glm::vec3 &) noexcept;
        void SetTexture(ArrayTexture &) noexcept;
+       void SetLight(int n, const glm::vec3 &pos, const glm::vec3 &color, float strength) noexcept;
+       void SetNumLights(int n) noexcept;
+
+       const glm::mat4 &M() const noexcept { return m; }
+       const glm::mat4 &V() const noexcept { return v; }
+       const glm::mat4 &P() const noexcept { return p; }
+       const glm::mat4 &MV() const noexcept { return mv; }
+       const glm::mat4 &MVP() const noexcept { return mvp; }
 
 private:
        Program prog;
 
+       int num_lights;
+
+       glm::mat4 m;
+       glm::mat4 v;
+       glm::mat4 p;
+       glm::mat4 mv;
+       glm::mat4 mvp;
+
        GLuint m_handle;
        GLuint mv_handle;
        GLuint mvp_handle;
        GLuint sampler_handle;
        GLuint normal_handle;
 
+       GLuint num_lights_handle;
+       GLuint light_handle[MAX_LIGHTS * 3];
+
 };
 
 }