From 26b1401d6cfdfd35afe275e287dc7d205902e55e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 1 May 2012 20:44:51 +0000 Subject: Added light environment classes --- src/render/lightenvironment.h | 80 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/render/lightenvironment.h (limited to 'src/render/lightenvironment.h') diff --git a/src/render/lightenvironment.h b/src/render/lightenvironment.h new file mode 100644 index 0000000..1f323d9 --- /dev/null +++ b/src/render/lightenvironment.h @@ -0,0 +1,80 @@ +/* + render/lightenvironment.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_RENDER_LIGHTENVIRONMENT_H__ +#define __INCLUDED_RENDER_LIGHTENVIRONMENT_H__ + +#include + +#include "render/light.h" + +namespace render +{ + +/** + * @brief a collection of lights + * */ +class LightEnvironment +{ +public: + LightEnvironment(); + + ~LightEnvironment(); + + /** + * @brief enable all lights in the environment + * */ + void enable(); + + /** + * @brief disable all lights in the environment + * */ + void disable(); + + /** + * @brief remove all lights in the environment + * */ + void clear(); + + /** + * @brief add a light to the environment + * */ + void add(Light *light); + + /** + * @brief transfer light environment to OpenGL state + */ + void draw(); + + /** + * @brief transfer light environment to OpenGL state + */ + void draw(const math::Vector3f translate); + + /** + * @brief number of lights in the environment + * */ + inline size_t size() const { + return env_container.size(); + } + +private: + typedef std::vector Container; + + Container env_container; + + int env_base_id; + + float env_attenuation; + float env_ambient_intensity; + float env_diffuse_intensity; + float env_specular_intensity; +}; + +} + +#endif // __INCLUDED_RENDER_LIGHTENVIRONMENT_H__ + -- cgit v1.2.3