Estensioni D3DXCOLOR

Nota

La libreria di utilità D3DX è deprecata. È consigliabile usare invece DirectXMath .

Fornisce gli overload e i cast dei tipi seguenti per le strutture D3DXCOLOR .

typedef struct D3DXCOLOR
{
#ifdef __cplusplus
public:
    D3DXCOLOR() {}
    D3DXCOLOR( DWORD argb );
    D3DXCOLOR( CONST FLOAT * );
    D3DXCOLOR( CONST D3DXFLOAT16 * );
    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
    FLOAT r, g, b, a;
} D3DXCOLOR, *LPD3DXCOLOR;

Tipi derivati: *LPD3DXCOLOR

Membri

Per altre informazioni sui membri della struttura, vedere D3DXCOLOR.

Commenti

Gli overload degli operatori e i cast di tipi per questa struttura vengono implementati in d3dx9math.inl.

Nota

Il costruttore D3DXCOLOR() si arresta in modo anomalo durante l'esecuzione in modalità di debug in Microsoft Visual Studio 2010 con l'opzione del compilatore Run-Time Error Check (/RTCc).

 

Requisiti

Requisito Valore
Intestazione
D3dx9math.h

Vedi anche

Strutture D3DX