#ifndef D3DXCOLOR_H #define D3DXCOLOR_H typedef struct _D3DCOLORVALUE { float r; float g; float b; float a; } D3DCOLORVALUE; typedef struct D3DXCOLOR { FLOAT r, g, b, a; #ifdef __cplusplus public: D3DXCOLOR() { } D3DXCOLOR( DWORD argb ); D3DXCOLOR( CONST FLOAT * ); D3DXCOLOR( CONST D3DCOLORVALUE& ); D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); // casting operator DWORD () const; operator FLOAT* (); operator CONST FLOAT* () const; operator D3DCOLORVALUE* (); operator CONST D3DCOLORVALUE* () const; operator D3DCOLORVALUE& (); operator CONST D3DCOLORVALUE& () const; // assignment operators D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); D3DXCOLOR& operator *= ( FLOAT ); D3DXCOLOR& operator /= ( FLOAT ); // unary operators D3DXCOLOR operator + () const; D3DXCOLOR operator - () const; // binary operators D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; D3DXCOLOR operator * ( FLOAT ) const; D3DXCOLOR operator / ( FLOAT ) const; friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR& ); BOOL operator == ( CONST D3DXCOLOR& ) const; BOOL operator != ( CONST D3DXCOLOR& ) const; #endif //__cplusplus } D3DXCOLOR; #endif