#include <CColor.h>
Public Member Functions | |
cColorf () | |
cColorf (const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0) | |
~cColorf () | |
void | set (const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0) |
void | setMem3 (const GLfloat *a_colorRGB) |
void | setMem4 (const GLfloat *a_colorRGBA) |
GLfloat | operator[] (const unsigned int n) const |
GLfloat & | operator[] (const unsigned int n) |
void | setR (const GLfloat a_red) |
GLfloat | getR () const |
void | setG (const GLfloat a_green) |
GLfloat | getG () const |
void | setB (const GLfloat a_blue) |
GLfloat | getB () const |
void | setA (const GLfloat a_alpha) |
GLfloat | getA () const |
void | render () const |
const GLfloat * | pColor () const |
cColorb | getColorb () const |
Public Attributes | |
GLfloat | m_color [4] |
Color in GLfloat format [R,G,B,A]. |
cColorf::cColorf | ( | ) | [inline] |
Default constructor of cColorf (color defaults to opaque white).
cColorf::cColorf | ( | const GLfloat | a_red, | |
const GLfloat | a_green, | |||
const GLfloat | a_blue, | |||
const GLfloat | a_alpha = 1.0 | |||
) | [inline] |
Constructor of cColorf. Define a color by passing its RGBA components as parameters.
a_red | Red component | |
a_green | Green component | |
a_blue | Blue component | |
a_alpha | Alpha component |
cColorf::~cColorf | ( | ) | [inline] |
Destructor of cColorf.
GLfloat cColorf::getA | ( | ) | const [inline] |
Read the alpha component.
GLfloat cColorf::getB | ( | ) | const [inline] |
Read the blue component.
cColorb cColorf::getColorb | ( | void | ) | const |
GLfloat cColorf::getG | ( | ) | const [inline] |
Read the green component.
GLfloat cColorf::getR | ( | ) | const [inline] |
Read the red component.
GLfloat& cColorf::operator[] | ( | const unsigned int | n | ) | [inline] |
Access the nth component of this color (we provide both const and non-const versions so you can use this operator as an l-value or an r-value).
GLfloat cColorf::operator[] | ( | const unsigned int | n | ) | const [inline] |
Access the nth component of this color (we provide both const and non-const versions so you can use this operator as an l-value or an r-value).
const GLfloat* cColorf::pColor | ( | ) | const [inline] |
Returns a pointer to the raw color array.
void cColorf::render | ( | ) | const [inline] |
Render this color in OpenGL (sets it to be the current color).
Does not confirm that GL color-tracking is enabled.
void cColorf::set | ( | const GLfloat | a_red, | |
const GLfloat | a_green, | |||
const GLfloat | a_blue, | |||
const GLfloat | a_alpha = 1.0 | |||
) | [inline] |
Set a color by passing its RGBA components as parameters.
a_red | Red component. | |
a_green | Green component. | |
a_blue | Blue component. | |
a_alpha | Alpha component. |
void cColorf::setA | ( | const GLfloat | a_alpha | ) | [inline] |
Set the alpha component.
a_alpha | Alpha component. |
void cColorf::setB | ( | const GLfloat | a_blue | ) | [inline] |
Set the blue component.
a_blue | Blue component. |
void cColorf::setG | ( | const GLfloat | a_green | ) | [inline] |
Set the green component.
a_green | Green component. |
void cColorf::setMem3 | ( | const GLfloat * | a_colorRGB | ) | [inline] |
Set color by copying three GLfloats from an external array, each describing one of the RGB components. Alpha is set to 1.0.
a_colorRGB | Pointer to an array of type float. |
void cColorf::setMem4 | ( | const GLfloat * | a_colorRGBA | ) | [inline] |
Set color by copying four GLfloats from an external array, each describing one of the RGBA components.
a_colorRGBA | Pointer to an array of type float. |
void cColorf::setR | ( | const GLfloat | a_red | ) | [inline] |
Set the red component.
a_red | Red component. |