2 * Copyright (C) 2016 Alistair Leslie-Hughes
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 /* This guard is the same as D3DX9 to prevent double-inclusion */
22 #ifndef __D3DX9MATH_H__
23 #define __D3DX9MATH_H__
27 typedef enum _D3DX_CPU_OPTIMIZATION
33 } D3DX_CPU_OPTIMIZATION
;
35 typedef struct D3DXFLOAT16
40 D3DXFLOAT16(const D3DXFLOAT16
&f
);
44 BOOL
operator==(const D3DXFLOAT16
&f
) const;
45 BOOL
operator!=(const D3DXFLOAT16
&f
) const;
48 } D3DXFLOAT16
, *LPD3DXFLOAT16
;
50 typedef struct D3DXCOLOR
55 D3DXCOLOR(UINT color
);
56 D3DXCOLOR(const float *color
);
57 D3DXCOLOR(const D3DXFLOAT16
*color
);
58 D3DXCOLOR(float r
, float g
, float b
, float a
);
60 operator UINT() const;
62 operator const float *() const;
64 D3DXCOLOR
& operator+=(const D3DXCOLOR
&color
);
65 D3DXCOLOR
& operator-=(const D3DXCOLOR
&color
);
66 D3DXCOLOR
& operator*=(float n
);
67 D3DXCOLOR
& operator/=(float n
);
69 D3DXCOLOR
operator+() const;
70 D3DXCOLOR
operator-() const;
72 D3DXCOLOR
operator+(const D3DXCOLOR
&color
) const;
73 D3DXCOLOR
operator-(const D3DXCOLOR
&color
) const;
74 D3DXCOLOR
operator*(float n
) const;
75 D3DXCOLOR
operator/(float n
) const;
77 friend D3DXCOLOR
operator*(float n
, const D3DXCOLOR
&color
);
79 BOOL
operator==(const D3DXCOLOR
&color
) const;
80 BOOL
operator!=(const D3DXCOLOR
&color
) const;
83 } D3DXCOLOR
, *LPD3DXCOLOR
;
89 D3DXCOLOR
*D3DXColorAdd(D3DXCOLOR
*out
, D3DXCOLOR c1
, D3DXCOLOR c2
);
90 D3DXCOLOR
*D3DXColorLerp(D3DXCOLOR
*out
, D3DXCOLOR c1
, D3DXCOLOR c2
, float s
);
91 D3DXCOLOR
*D3DXColorModulate(D3DXCOLOR
*out
, D3DXCOLOR c1
, D3DXCOLOR c2
);
92 D3DXCOLOR
*D3DXColorScale(D3DXCOLOR
*out
, D3DXCOLOR c
, float s
);
93 D3DXCOLOR
*D3DXColorSubtract(D3DXCOLOR
*out
, D3DXCOLOR c1
, D3DXCOLOR c2
);
94 D3DX_CPU_OPTIMIZATION WINAPI
D3DXCpuOptimizations(BOOL enable
);
100 #endif /* __D3DX9MATH_H__ */