X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FPlanetSurface.hpp;h=94e201ece7e63760a890d4e50b39f2c30f1b49a3;hb=refs%2Fheads%2Fmaster;hp=2482703b070b8eff0fe4e07409933b0b852afb92;hpb=0453d6da05d4b29d953f00857d743310d9344ce0;p=blobs.git diff --git a/src/graphics/PlanetSurface.hpp b/src/graphics/PlanetSurface.hpp index 2482703..94e201e 100644 --- a/src/graphics/PlanetSurface.hpp +++ b/src/graphics/PlanetSurface.hpp @@ -3,8 +3,6 @@ #include "Program.hpp" -#include "glm.hpp" - namespace blobs { namespace graphics { @@ -13,6 +11,9 @@ class ArrayTexture; class PlanetSurface { +public: + static constexpr int MAX_LIGHTS = 8; + public: PlanetSurface(); ~PlanetSurface(); @@ -26,10 +27,14 @@ public: public: void Activate() noexcept; + void SetM(const glm::mat4 &m) noexcept; + void SetV(const glm::mat4 &v) 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(const glm::vec3 &pos, const glm::vec3 &color, float strength) noexcept; + void SetAmbient(const glm::vec3 &) 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; } @@ -40,6 +45,8 @@ public: private: Program prog; + int num_lights; + glm::mat4 m; glm::mat4 v; glm::mat4 p; @@ -50,11 +57,10 @@ private: GLuint mv_handle; GLuint mvp_handle; GLuint sampler_handle; - GLuint normal_handle; + GLuint ambient_handle; - GLuint light_position_handle; - GLuint light_color_handle; - GLuint light_strength_handle; + GLuint num_lights_handle; + GLuint light_handle[MAX_LIGHTS * 3]; };