|
ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Ambient colour that changes over a repeating cycle, such as a day. More...
#include <lighting.h>
Public Member Functions | |
| AmbientCycle (float length=1.0F) | |
| Create a cycle. | |
| void | add (float time, const asw::Color &color) |
| Add a key colour. Colours between keys are blended. | |
| asw::Color | at (float time) const |
| Get the colour at a time. Times past the length wrap around. | |
| float | get_length () const |
| Get the length of one cycle. | |
Private Attributes | |
| float | length |
| std::vector< std::pair< float, asw::Color > > | keys |
Ambient colour that changes over a repeating cycle, such as a day.
Definition at line 84 of file lighting.h.
|
explicit |
Create a cycle.
| length | Length of one cycle, in the same units as at(). |
Definition at line 125 of file lighting.cpp.
| void asw::lighting::AmbientCycle::add | ( | float | time, |
| const asw::Color & | color ) |
Add a key colour. Colours between keys are blended.
| time | When in the cycle, from 0 to the length. |
| color | The ambient colour at that time. |
Definition at line 130 of file lighting.cpp.
| asw::Color asw::lighting::AmbientCycle::at | ( | float | time | ) | const |
Get the colour at a time. Times past the length wrap around.
| time | The time. |
Definition at line 136 of file lighting.cpp.
| float asw::lighting::AmbientCycle::get_length | ( | ) | const |
Get the length of one cycle.
Definition at line 162 of file lighting.cpp.
|
private |
Definition at line 112 of file lighting.h.
|
private |
Definition at line 111 of file lighting.h.