diff options
author | Stijn Buys <ingar@osirion.org> | 2012-05-01 20:44:51 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-05-01 20:44:51 +0000 |
commit | 26b1401d6cfdfd35afe275e287dc7d205902e55e (patch) | |
tree | befd04ee2ade7e7e5c1a1a93b42bc4d07252444f /src/render/lightenvironment.h | |
parent | 486f74a45c8241862f2b94d63e54aeb2bc5d5424 (diff) |
Added light environment classes
Diffstat (limited to 'src/render/lightenvironment.h')
-rw-r--r-- | src/render/lightenvironment.h | 80 |
1 files changed, 80 insertions, 0 deletions
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 <vector> + +#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 <Light *> 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__ + |