aboutsummaryrefslogtreecommitdiff
path: root/apps/openmb/renderer/DirectionalLight.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/openmb/renderer/DirectionalLight.hpp')
-rw-r--r--apps/openmb/renderer/DirectionalLight.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/openmb/renderer/DirectionalLight.hpp b/apps/openmb/renderer/DirectionalLight.hpp
new file mode 100644
index 0000000..31e914e
--- /dev/null
+++ b/apps/openmb/renderer/DirectionalLight.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "Shader.hpp"
+#include <glm/glm.hpp>
+
+namespace renderer {
+
+class DirectionalLight {
+ public:
+ DirectionalLight();
+
+ void setDirection( const glm::vec3& dir );
+ void setColor( const glm::vec3& c );
+ void setIntensity( float i );
+
+ const glm::vec3& getDirection() const;
+ const glm::vec3& getColor() const;
+ float getIntensity() const;
+
+ void applyToShader( const Shader& shader, const std::string& uniformName = "dirLight" ) const;
+
+ private:
+ glm::vec3 mDirection;
+ glm::vec3 mColor;
+ float mIntensity;
+};
+
+} // namespace renderer