OpenGLPrakt --> cColor

class cColor

class for RGB(A) color

This class is used to represent an "OpenGL compatible" color. It is a class of its own (its not derived from anything). It has an operator GLfloat *(), so it can be used directly within calls to glColor3f/glColor4f

Source:
../src/cColor.hh:28

Nested Classes, Structs and Unions:
uRgbaColor [protected] union to represent an OpenGL RGB(A)

Constructors Index

cColor
[public] default constructor
cColor
[public] constructor w/ initialization (alpha is optional)
~cColor
[public] destructor


Variables Index

mColor
[protected]


Methods Index

GetA
[public] return alpha value
GetB
[public] return blue value
GetColor
[public] retrieve actual color
GetColor
[public] retrieve actual color
GetG
[public] return green value
GetR
[public] return red value
operator constGLfloat*
[public] operator for casting to (GLfloat *)
operator GLfloat*
[public]
SetColor
[public] assign new color


Constructors

cColor

public cColor ( ) ;

default constructor

cColor

public cColor ( GLfloat r ,
                GLfloat g ,
                GLfloat b ,
                GLfloat a = 1 . 0 ) ;

constructor w/ initialization (alpha is optional)

Parameters:
r red component
g green component
b blue component
a alpha component (optional, default = 1.0 = opaque)

cColor

public ~ cColor ( ) ;

destructor


Variables

mColor

protected uRgbaColor mColor


Methods

operator constGLfloat*

public operator const GLfloat * ( ) const ;

operator for casting to (GLfloat *)

operator GLfloat*

public operator GLfloat * ( ) ;

SetColor

public void SetColor ( GLfloat r ,
                       GLfloat g ,
                       GLfloat b ,
                       GLfloat a = 1 . 0 ) ;

assign new color

Parameters:
r red component
g green component
b blue component
a alpha component (optional, default = 1.0 = opaque)

GetColor

public void GetColor ( GLfloat & r ,
                       GLfloat & g ,
                       GLfloat & b ) ;

retrieve actual color

Parameters:
r reference to variable which will hold red value
g ... green value
b ... blue value

GetColor

public void GetColor ( GLfloat & r ,
                       GLfloat & g ,
                       GLfloat & b ,
                       GLfloat & a ) ;

retrieve actual color

Parameters:
r reference to variable which will hold red value
g ... green value
b ... blue value
a ... alpha value

GetR

public GLfloat GetR ( ) const ;

return red value

GetG

public GLfloat GetG ( ) const ;

return green value

GetB

public GLfloat GetB ( ) const ;

return blue value

GetA

public GLfloat GetA ( ) const ;

return alpha value


This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.