Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

CColor Class Reference

#include <cvideo.h>

List of all members.

Public Member Functions

 CColor (uint32 n_color=0)
 CColor (uint8 r, uint8 g, uint8 b)
 operator uint32 () const


Detailed Description

The CColor object represents a color on a surface (including the screen, since it's a surface), and it's stored as a 32-bit integer, since virtually all architectures store a pixel color using <= 32 bits.

Note that this class isn't abstract, partially for performance reasons; making it abstract would require a vtable, increasing the size of the color, and virtual functions would slow down the methods of a class that is probably going to be used quite a bit. Most of all, however, this is the kind of structure that really doesn't have much of an actual need *need* to have multiple implementations, and it's easier to have the class just ask the video system manager for architecture-specific concerns than it is to subclass the color object in every concrete video driver implementation.

Definition at line 198 of file cvideo.h.


Constructor & Destructor Documentation

CColor::CColor uint32  n_color = 0  )  [inline]
 

Create a color with the given surface-specific color value (i.e., the CColor object doesn't ask the CVideoSystem anything about conversion, it just stores the given number directly).

Definition at line 207 of file cvideo.h.

CColor::CColor uint8  r,
uint8  g,
uint8  b
[inline]
 

Creates a new color with the given red, green, and blue components (from 0-255), creating the 32-bit color value by asking the CVideoSystem to make it for us.

Definition at line 212 of file cvideo.h.

References CSingletonManager< CVideoSystem >::get_instance(), and CVideoSystem::make_color().

Here is the call graph for this function:


Member Function Documentation

CColor::operator uint32  )  const [inline]
 

Automatic type conversion for return the integral color value.

Definition at line 215 of file cvideo.h.


The documentation for this class was generated from the following file:
Generated on Wed Aug 27 11:58:44 2003 for GFW by doxygen 1.3.3