2021-12-09 04:14:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shader.h"
|
|
|
|
#include "../renderable.h"
|
|
|
|
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
|
|
|
namespace simpleengine::gfx {
|
|
|
|
class Light : public simpleengine::Renderable {
|
|
|
|
public:
|
|
|
|
gfx::Shader shader;
|
|
|
|
glm::vec3 position;
|
|
|
|
glm::vec3 color;
|
|
|
|
|
|
|
|
Light(gfx::Shader shader, glm::vec3 position, glm::vec3 color) : shader(shader), position(position), color(color) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void update(const float& delta_time) override {
|
|
|
|
shader.use();
|
2022-09-28 12:04:24 +00:00
|
|
|
shader.set_uniform_float_vec3("u_light_position", position, false);
|
|
|
|
shader.set_uniform_float_vec3("u_light_color", color, false);
|
2021-12-09 04:14:45 +00:00
|
|
|
shader.unuse();
|
|
|
|
}
|
|
|
|
|
2022-09-16 15:14:38 +00:00
|
|
|
virtual void render() override {
|
2021-12-09 04:14:45 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|