mshtml: Implement IHTMLBodyElement get/put bgColor.
[wine.git] / dlls / d3dx9_36 / math.c
blobdeb52d2dd660f9c31586bd7b96d198e76b4e46c7
1 /*
2 * Mathematical operations specific to D3DX9.
4 * Copyright (C) 2008 Philip Nilsson
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
22 #include "windef.h"
23 #include "wingdi.h"
24 #include "wine/debug.h"
25 #include "d3dx9.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
29 /*************************************************************************
30 * D3DXPlaneTransformArray
32 D3DXPLANE* WINAPI D3DXPlaneTransformArray(
33 D3DXPLANE* out, UINT outstride, CONST D3DXPLANE* in, UINT instride,
34 CONST D3DXMATRIX* matrix, UINT elements)
36 UINT i;
37 TRACE("\n");
38 for (i = 0; i < elements; ++i) {
39 D3DXPlaneTransform(
40 (D3DXPLANE*)((char*)out + outstride * i),
41 (CONST D3DXPLANE*)((const char*)in + instride * i),
42 matrix);
44 return out;
47 /*************************************************************************
48 * D3DXVec2TransformArray
50 * Transform an array of vectors by a matrix.
52 D3DXVECTOR4* WINAPI D3DXVec2TransformArray(
53 D3DXVECTOR4* out, UINT outstride, CONST D3DXVECTOR2* in, UINT instride,
54 CONST D3DXMATRIX* matrix, UINT elements)
56 UINT i;
57 TRACE("\n");
58 for (i = 0; i < elements; ++i) {
59 D3DXVec2Transform(
60 (D3DXVECTOR4*)((char*)out + outstride * i),
61 (CONST D3DXVECTOR2*)((const char*)in + instride * i),
62 matrix);
64 return out;
67 /*************************************************************************
68 * D3DXVec2TransformCoordArray
70 D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray(
71 D3DXVECTOR2* out, UINT outstride, CONST D3DXVECTOR2* in, UINT instride,
72 CONST D3DXMATRIX* matrix, UINT elements)
74 UINT i;
75 TRACE("\n");
76 for (i = 0; i < elements; ++i) {
77 D3DXVec2TransformCoord(
78 (D3DXVECTOR2*)((char*)out + outstride * i),
79 (CONST D3DXVECTOR2*)((const char*)in + instride * i),
80 matrix);
82 return out;
85 /*************************************************************************
86 * D3DXVec2TransformNormalArray
88 D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray(
89 D3DXVECTOR2* out, UINT outstride, CONST D3DXVECTOR2 *in, UINT instride,
90 CONST D3DXMATRIX *matrix, UINT elements)
92 UINT i;
93 TRACE("\n");
94 for (i = 0; i < elements; ++i) {
95 D3DXVec2TransformNormal(
96 (D3DXVECTOR2*)((char*)out + outstride * i),
97 (CONST D3DXVECTOR2*)((const char*)in + instride * i),
98 matrix);
100 return out;
103 /*************************************************************************
104 * D3DXVec3ProjectArray
106 * Projects an array of vectors to the screen.
108 D3DXVECTOR3* WINAPI D3DXVec3ProjectArray(
109 D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride,
110 CONST D3DVIEWPORT9* viewport, CONST D3DXMATRIX* projection,
111 CONST D3DXMATRIX* view, CONST D3DXMATRIX* world, UINT elements)
113 UINT i;
114 TRACE("\n");
115 for (i = 0; i < elements; ++i) {
116 D3DXVec3Project(
117 (D3DXVECTOR3*)((char*)out + outstride * i),
118 (CONST D3DXVECTOR3*)((const char*)in + instride * i),
119 viewport, projection, view, world);
121 return out;
124 /*************************************************************************
125 * D3DXVec3TransformArray
127 D3DXVECTOR4* WINAPI D3DXVec3TransformArray(
128 D3DXVECTOR4* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride,
129 CONST D3DXMATRIX* matrix, UINT elements)
131 UINT i;
132 TRACE("\n");
133 for (i = 0; i < elements; ++i) {
134 D3DXVec3Transform(
135 (D3DXVECTOR4*)((char*)out + outstride * i),
136 (CONST D3DXVECTOR3*)((const char*)in + instride * i),
137 matrix);
139 return out;
142 /*************************************************************************
143 * D3DXVec3TransformCoordArray
145 D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray(
146 D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride,
147 CONST D3DXMATRIX* matrix, UINT elements)
149 UINT i;
150 TRACE("\n");
151 for (i = 0; i < elements; ++i) {
152 D3DXVec3TransformCoord(
153 (D3DXVECTOR3*)((char*)out + outstride * i),
154 (CONST D3DXVECTOR3*)((const char*)in + instride * i),
155 matrix);
157 return out;
160 /*************************************************************************
161 * D3DXVec3TransformNormalArray
163 D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray(
164 D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride,
165 CONST D3DXMATRIX* matrix, UINT elements)
167 UINT i;
168 TRACE("\n");
169 for (i = 0; i < elements; ++i) {
170 D3DXVec3TransformNormal(
171 (D3DXVECTOR3*)((char*)out + outstride * i),
172 (CONST D3DXVECTOR3*)((const char*)in + instride * i),
173 matrix);
175 return out;
178 /*************************************************************************
179 * D3DXVec3UnprojectArray
181 D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray(
182 D3DXVECTOR3* out, UINT outstride, CONST D3DXVECTOR3* in, UINT instride,
183 CONST D3DVIEWPORT9* viewport, CONST D3DXMATRIX* projection,
184 CONST D3DXMATRIX* view, CONST D3DXMATRIX* world, UINT elements)
186 UINT i;
187 TRACE("\n");
188 for (i = 0; i < elements; ++i) {
189 D3DXVec3Unproject(
190 (D3DXVECTOR3*)((char*)out + outstride * i),
191 (CONST D3DXVECTOR3*)((const char*)in + instride * i),
192 viewport, projection, view, world);
194 return out;
197 /*************************************************************************
198 * D3DXVec4TransformArray
200 D3DXVECTOR4* WINAPI D3DXVec4TransformArray(
201 D3DXVECTOR4* out, UINT outstride, CONST D3DXVECTOR4* in, UINT instride,
202 CONST D3DXMATRIX* matrix, UINT elements)
204 UINT i;
205 TRACE("\n");
206 for (i = 0; i < elements; ++i) {
207 D3DXVec4Transform(
208 (D3DXVECTOR4*)((char*)out + outstride * i),
209 (CONST D3DXVECTOR4*)((const char*)in + instride * i),
210 matrix);
212 return out;