Make sure sed uses the right locale.
[wine.git] / include / d3d8types.h
blob5253cfaff4807b7efc1bf2926cd9bf19d92fabad
1 /*
2 * Copyright (C) 2002 Jason Edmeades
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_D3D8TYPES_H
20 #define __WINE_D3D8TYPES_H
23 /*****************************************************************************
24 * Direct 3D v8 #defines
27 #define D3DCLEAR_TARGET 1
28 #define D3DCLEAR_ZBUFFER 2
29 #define D3DCLEAR_STENCIL 4
31 #define D3DCLIPPLANE0 (1 << 0)
32 #define D3DCLIPPLANE1 (1 << 1)
33 #define D3DCLIPPLANE2 (1 << 2)
34 #define D3DCLIPPLANE3 (1 << 3)
35 #define D3DCLIPPLANE4 (1 << 4)
36 #define D3DCLIPPLANE5 (1 << 5)
38 #define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
39 #define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
40 #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
41 #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
43 #define D3DCOLORWRITEENABLED_RED 1
44 #define D3DCOLORWRITEENABLED_GREEN 2
45 #define D3DCOLORWRITEENABLED_BLUE 4
46 #define D3DCOLORWRITEENABLED_ALPHA 8
48 #define D3DCS_LEFT 0x001
49 #define D3DCS_RIGHT 0x002
50 #define D3DCS_TOP 0x004
51 #define D3DCS_BOTTOM 0x008
52 #define D3DCS_FRONT 0x010
53 #define D3DCS_BACK 0x020
54 #define D3DCS_PLANE0 0x040
55 #define D3DCS_PLANE1 0x080
56 #define D3DCS_PLANE2 0x100
57 #define D3DCS_PLANE3 0x200
58 #define D3DCS_PLANE4 0x400
59 #define D3DCS_PLANE5 0x800
60 #define D3DCS_ALL 0xFFF
62 #define D3DFVF_TEXTUREFORMAT1 3
63 #define D3DFVF_TEXTUREFORMAT2 0
64 #define D3DFVF_TEXTUREFORMAT3 1
65 #define D3DFVF_TEXTUREFORMAT4 2
66 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
67 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
68 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
69 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
71 #define D3DLOCK_READONLY 0x0010
72 #define D3DLOCK_NOSYSLOCK 0x0800
73 #define D3DLOCK_NOOVERWRITE 0x1000
74 #define D3DLOCK_DISCARD 0x2000
75 #define D3DLOCK_NO_DIRTY_UPDATE 0x8000
77 #define D3DMAXUSERCLIPPLANES 32
79 #define D3DRENDERSTATE_WRAPBIAS 0x80
81 #define D3DTSS_TCI_PASSTHRU 0x00000
82 #define D3DTSS_TCI_CAMERASPACENORMAL 0x10000
83 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000
84 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x30000
87 #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
88 #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
89 #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
90 #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
91 #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
93 #define D3DUSAGE_RENDERTARGET 0x01
94 #define D3DUSAGE_DEPTHSTENCIL 0x02
95 #define D3DUSAGE_WRITEONLY 0x08
96 #define D3DUSAGE_SOFTWAREPROCESSING 0x10
97 #define D3DUSAGE_DONOTCLIP 0x20
98 #define D3DUSAGE_POINTS 0x40
99 #define D3DUSAGE_RTPATCHES 0x80
100 #define D3DUSAGE_NPATCHES 0x100
101 #define D3DUSAGE_DYNAMIC 0x200
103 #define D3DWRAP_U 1
104 #define D3DWRAP_V 2
105 #define D3DWRAP_W 4
106 #define D3DWRAPCOORD_0 1
107 #define D3DWRAPCOORD_1 2
108 #define D3DWRAPCOORD_2 4
109 #define D3DWRAPCOORD_3 8
111 #define MAX_DEVICE_IDENTIFIER_STRING 512
113 #define D3DFVF_RESERVED0 0x0001
114 #define D3DFVF_POSITION_MASK 0x000E
115 #define D3DFVF_XYZ 0x0002
116 #define D3DFVF_XYZRHW 0x0004
117 #define D3DFVF_XYZB1 0x0006
118 #define D3DFVF_XYZB2 0x0008
119 #define D3DFVF_XYZB3 0x000a
120 #define D3DFVF_XYZB4 0x000c
121 #define D3DFVF_XYZB5 0x000e
122 #define D3DFVF_NORMAL 0x0010
123 #define D3DFVF_PSIZE 0x0020
124 #define D3DFVF_DIFFUSE 0x0040
125 #define D3DFVF_SPECULAR 0x0080
126 #define D3DFVF_TEXCOUNT_MASK 0x0f00
127 #define D3DFVF_TEXCOUNT_SHIFT 8
128 #define D3DFVF_TEX0 0x0000
129 #define D3DFVF_TEX1 0x0100
130 #define D3DFVF_TEX2 0x0200
131 #define D3DFVF_TEX3 0x0300
132 #define D3DFVF_TEX4 0x0400
133 #define D3DFVF_TEX5 0x0500
134 #define D3DFVF_TEX6 0x0600
135 #define D3DFVF_TEX7 0x0700
136 #define D3DFVF_TEX8 0x0800
137 #define D3DFVF_LASTBETA_UBYTE4 0x1000
138 #define D3DFVF_RESERVED2 0xE000
140 #define D3DTA_SELECTMASK 0x0000000f
141 #define D3DTA_DIFFUSE 0x00000000
142 #define D3DTA_CURRENT 0x00000001
143 #define D3DTA_TEXTURE 0x00000002
144 #define D3DTA_TFACTOR 0x00000003
145 #define D3DTA_SPECULAR 0x00000004
146 #define D3DTA_COMPLEMENT 0x00000010
147 #define D3DTA_ALPHAREPLICATE 0x00000020
148 #define D3DTA_TEMP 0x00000005
150 #define D3DCOLORWRITEENABLE_RED (1L<<0)
151 #define D3DCOLORWRITEENABLE_GREEN (1L<<1)
152 #define D3DCOLORWRITEENABLE_BLUE (1L<<2)
153 #define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
157 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
158 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
159 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
162 /****************************
163 * Vertex Shaders Declaration
166 typedef enum _D3DVSD_TOKENTYPE {
167 D3DVSD_TOKEN_NOP = 0,
168 D3DVSD_TOKEN_STREAM = 1,
169 D3DVSD_TOKEN_STREAMDATA = 2,
170 D3DVSD_TOKEN_TESSELLATOR = 3,
171 D3DVSD_TOKEN_CONSTMEM = 4,
172 D3DVSD_TOKEN_EXT = 5,
173 /* RESERVED = 6 */
174 D3DVSD_TOKEN_END = 7,
175 D3DVSD_FORCE_DWORD = 0x7FFFFFFF
176 } D3DVSD_TOKENTYPE;
178 /** input registers for vertes shaders functions */
180 #define D3DVSDE_POSITION 0
181 #define D3DVSDE_BLENDWEIGHT 1
182 #define D3DVSDE_BLENDINDICES 2
183 #define D3DVSDE_NORMAL 3
184 #define D3DVSDE_PSIZE 4
185 #define D3DVSDE_DIFFUSE 5
186 #define D3DVSDE_SPECULAR 6
187 #define D3DVSDE_TEXCOORD0 7
188 #define D3DVSDE_TEXCOORD1 8
189 #define D3DVSDE_TEXCOORD2 9
190 #define D3DVSDE_TEXCOORD3 10
191 #define D3DVSDE_TEXCOORD4 11
192 #define D3DVSDE_TEXCOORD5 12
193 #define D3DVSDE_TEXCOORD6 13
194 #define D3DVSDE_TEXCOORD7 14
195 #define D3DVSDE_POSITION2 15
196 #define D3DVSDE_NORMAL2 16
198 /** Address of the vertex register. 0 - 16 */
199 typedef enum _D3DVSDE_REGISTER {
200 D3DVSDE_POSITION = 0,
201 D3DVSDE_BLENDWEIGHT = 1,
202 D3DVSDE_BLENDINDICES = 2,
203 D3DVSDE_NORMAL = 3,
204 D3DVSDE_PSIZE = 4,
205 D3DVSDE_DIFFUSE = 5,
206 D3DVSDE_SPECULAR = 6,
207 D3DVSDE_TEXCOORD0 = 7,
208 D3DVSDE_TEXCOORD1 = 8,
209 D3DVSDE_TEXCOORD2 = 9,
210 D3DVSDE_TEXCOORD3 = 10,
211 D3DVSDE_TEXCOORD4 = 11,
212 D3DVSDE_TEXCOORD5 = 12,
213 D3DVSDE_TEXCOORD6 = 13,
214 D3DVSDE_TEXCOORD7 = 14,
215 D3DVSDE_POSITION2 = 15,
216 D3DVSDE_NORMAL2 = 16
217 } D3DVSDE_REGISTER;
219 /** bit-field declaration for VertexRegister Type */
221 #define D3DVSDT_FLOAT1 0x00
222 #define D3DVSDT_FLOAT2 0x01
223 #define D3DVSDT_FLOAT3 0x02
224 #define D3DVSDT_FLOAT4 0x03
225 #define D3DVSDT_D3DCOLOR 0x04
226 #define D3DVSDT_UBYTE4 0x05
227 #define D3DVSDT_SHORT2 0x06
228 #define D3DVSDT_SHORT4 0x07
230 typedef enum _D3DVSDT_TYPE {
231 D3DVSDT_FLOAT1 = 0x00,
232 D3DVSDT_FLOAT2 = 0x01,
233 D3DVSDT_FLOAT3 = 0x02,
234 D3DVSDT_FLOAT4 = 0x03,
235 D3DVSDT_D3DCOLOR = 0x04,
236 D3DVSDT_UBYTE4 = 0x05,
237 D3DVSDT_SHORT2 = 0x06,
238 D3DVSDT_SHORT4 = 0x07
239 } D3DVSDT_TYPE;
242 #define D3DVSD_CONSTADDRESSSHIFT 0
243 #define D3DVSD_EXTINFOSHIFT 0
244 #define D3DVSD_STREAMNUMBERSHIFT 0
245 #define D3DVSD_VERTEXREGSHIFT 0
246 #define D3DVSD_CONSTRSSHIFT 16
247 #define D3DVSD_DATATYPESHIFT 16
248 #define D3DVSD_SKIPCOUNTSHIFT 16
249 #define D3DVSD_VERTEXREGINSHIFT 20
250 #define D3DVSD_EXTCOUNTSHIFT 24
251 #define D3DVSD_CONSTCOUNTSHIFT 25
252 #define D3DVSD_DATALOADTYPESHIFT 28
253 #define D3DVSD_STREAMTESSSHIFT 28
254 #define D3DVSD_TOKENTYPESHIFT 29
256 #define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT)
257 #define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT)
258 #define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT)
259 #define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT)
260 #define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT)
261 #define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT)
262 #define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT)
263 #define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT)
264 #define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT)
265 #define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT)
266 #define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT)
267 #define D3DVSD_STREAMTESSMASK (0x1 << D3DVSD_STREAMTESSSHIFT)
268 #define D3DVSD_TOKENTYPEMASK (0x7 << D3DVSD_TOKENTYPESHIFT)
271 #define D3DVSD_MAKETOKENTYPE(TokenType) \
272 ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
274 #define D3DVSD_CONST(ConstantAddress, Count) \
275 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
277 #define D3DVSD_END() 0xFFFFFFFF
279 #define D3DVSD_NOP() 0x00000000
281 #define D3DVSD_REG(VertexRegister, Type) \
282 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
284 #define D3DVSD_SKIP(Count) \
285 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
287 #define D3DVSD_STREAM(StreamNumber) \
288 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
290 #define D3DVSD_STREAM_TESS() \
291 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
293 #define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
294 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
296 #define D3DVSD_TESSUV(Register) \
297 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
300 /********************************
301 * Pixel/Vertex Shaders Functions
304 /** Maximum number of supported texture coordinates sets operation */
305 #define D3DDP_MAXTEXCOORD 8
307 /** opcode token mask */
308 #define D3DSI_OPCODE_MASK 0x0000FFFF
310 /** opcodes types for PS and VS */
311 typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
312 D3DSIO_NOP = 0,
313 D3DSIO_MOV = 1,
314 D3DSIO_ADD = 2,
315 D3DSIO_SUB = 3,
316 D3DSIO_MAD = 4,
317 D3DSIO_MUL = 5,
318 D3DSIO_RCP = 6,
319 D3DSIO_RSQ = 7,
320 D3DSIO_DP3 = 8,
321 D3DSIO_DP4 = 9,
322 D3DSIO_MIN = 10,
323 D3DSIO_MAX = 11,
324 D3DSIO_SLT = 12,
325 D3DSIO_SGE = 13,
326 D3DSIO_EXP = 14,
327 D3DSIO_LOG = 15,
328 D3DSIO_LIT = 16,
329 D3DSIO_DST = 17,
330 D3DSIO_LRP = 18,
331 D3DSIO_FRC = 19,
332 D3DSIO_M4x4 = 20,
333 D3DSIO_M4x3 = 21,
334 D3DSIO_M3x4 = 22,
335 D3DSIO_M3x3 = 23,
336 D3DSIO_M3x2 = 24,
338 D3DSIO_TEXCOORD = 64,
339 D3DSIO_TEXKILL = 65,
340 D3DSIO_TEX = 66,
341 D3DSIO_TEXBEM = 67,
342 D3DSIO_TEXBEML = 68,
343 D3DSIO_TEXREG2AR = 69,
344 D3DSIO_TEXREG2GB = 70,
345 D3DSIO_TEXM3x2PAD = 71,
346 D3DSIO_TEXM3x2TEX = 72,
347 D3DSIO_TEXM3x3PAD = 73,
348 D3DSIO_TEXM3x3TEX = 74,
349 D3DSIO_TEXM3x3DIFF = 75,
350 D3DSIO_TEXM3x3SPEC = 76,
351 D3DSIO_TEXM3x3VSPEC = 77,
352 D3DSIO_EXPP = 78,
353 D3DSIO_LOGP = 79,
354 D3DSIO_CND = 80,
355 D3DSIO_DEF = 81,
356 D3DSIO_TEXREG2RGB = 82,
357 D3DSIO_TEXDP3TEX = 83,
358 D3DSIO_TEXM3x2DEPTH = 84,
359 D3DSIO_TEXDP3 = 85,
360 D3DSIO_TEXM3x3 = 86,
361 D3DSIO_TEXDEPTH = 87,
362 D3DSIO_CMP = 88,
363 D3DSIO_BEM = 89,
365 D3DSIO_PHASE = 0xFFFD,
366 D3DSIO_COMMENT = 0xFFFE,
367 D3DSIO_END = 0XFFFF,
369 D3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */
370 } D3DSHADER_INSTRUCTION_OPCODE_TYPE;
372 /** for parallelism */
373 #define D3DSI_COISSUE 0x40000000
375 /** destination parameter modifiers (.xyzw) */
376 #define D3DSP_WRITEMASK_0 0x00010000 /* .x r */
377 #define D3DSP_WRITEMASK_1 0x00020000 /* .y g */
378 #define D3DSP_WRITEMASK_2 0x00040000 /* .z b */
379 #define D3DSP_WRITEMASK_3 0x00080000 /* .w a */
380 #define D3DSP_WRITEMASK_ALL 0x000F0000 /* all */
382 #define D3DSP_DSTMOD_SHIFT 20
383 #define D3DSP_DSTMOD_MASK (0xF << D3DSP_DSTMOD_SHIFT)
385 typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
386 D3DSPDM_NONE = 0 << D3DSP_DSTMOD_SHIFT,
387 D3DSPDM_SATURATE = 1 << D3DSP_DSTMOD_SHIFT,
388 D3DSPDM_FORCE_DWORD = 0X7FFFFFFF
389 } D3DSHADER_PARAM_DSTMOD_TYPE;
391 /** destination param */
392 #define D3DSP_DSTSHIFT_SHIFT 24
393 #define D3DSP_DSTSHIFT_MASK (0xF << D3DSP_DSTSHIFT_SHIFT)
395 /** destination/source reg type */
396 #define D3DSP_REGTYPE_SHIFT 28
397 #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT)
399 typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
400 D3DSPR_TEMP = 0 << D3DSP_REGTYPE_SHIFT,
401 D3DSPR_INPUT = 1 << D3DSP_REGTYPE_SHIFT,
402 D3DSPR_CONST = 2 << D3DSP_REGTYPE_SHIFT,
403 D3DSPR_ADDR = 3 << D3DSP_REGTYPE_SHIFT,
404 D3DSPR_TEXTURE = 3 << D3DSP_REGTYPE_SHIFT,
405 D3DSPR_RASTOUT = 4 << D3DSP_REGTYPE_SHIFT,
406 D3DSPR_ATTROUT = 5 << D3DSP_REGTYPE_SHIFT,
407 D3DSPR_TEXCRDOUT = 6 << D3DSP_REGTYPE_SHIFT,
408 D3DSPR_FORCE_DWORD = 0x7FFFFFFF
409 } D3DSHADER_PARAM_REGISTER_TYPE;
411 typedef enum _D3DVS_RASTOUT_OFFSETS {
412 D3DSRO_POSITION = 0,
413 D3DSRO_FOG = 1,
414 D3DSRO_POINT_SIZE = 2,
415 D3DSRO_FORCE_DWORD = 0x7FFFFFFF
416 } D3DVS_RASTOUT_OFFSETS;
418 #define D3DVS_ADDRESSMODE_SHIFT 13
419 #define D3DVS_ADDRESSMODE_MASK (0x1 << D3DVS_ADDRESSMODE_SHIFT)
421 typedef enum _D3DVS_ADDRESSMODE_TYPE {
422 D3DVS_ADDRMODE_ABSOLUTE = 0 << D3DVS_ADDRESSMODE_SHIFT,
423 D3DVS_ADDRMODE_RELATIVE = 1 << D3DVS_ADDRESSMODE_SHIFT,
424 D3DVS_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
425 } D3DVS_ADDRESSMODE_TYPE;
427 #define D3DVS_SWIZZLE_SHIFT 16
428 #define D3DVS_SWIZZLE_MASK (0xFF << D3DVS_SWIZZLE_SHIFT)
430 #define D3DSP_SWIZZLE_SHIFT 16
431 #define D3DSP_SWIZZLE_MASK (0xFF << D3DSP_SWIZZLE_SHIFT)
433 #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
434 #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
435 #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
436 #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
438 #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
439 #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
440 #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
441 #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
443 #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
444 #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
445 #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
446 #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
448 #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
449 #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
450 #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
451 #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
453 #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
455 #define D3DSP_NOSWIZZLE \
456 ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
458 #define D3DSP_SRCMOD_SHIFT 24
459 #define D3DSP_SRCMOD_MASK (0xF << D3DSP_SRCMOD_SHIFT)
461 typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
462 D3DSPSM_NONE = 0 << D3DSP_SRCMOD_SHIFT,
463 D3DSPSM_NEG = 1 << D3DSP_SRCMOD_SHIFT,
464 D3DSPSM_BIAS = 2 << D3DSP_SRCMOD_SHIFT,
465 D3DSPSM_BIASNEG = 3 << D3DSP_SRCMOD_SHIFT,
466 D3DSPSM_SIGN = 4 << D3DSP_SRCMOD_SHIFT,
467 D3DSPSM_SIGNNEG = 5 << D3DSP_SRCMOD_SHIFT,
468 D3DSPSM_COMP = 6 << D3DSP_SRCMOD_SHIFT,
469 D3DSPSM_X2 = 7 << D3DSP_SRCMOD_SHIFT,
470 D3DSPSM_X2NEG = 8 << D3DSP_SRCMOD_SHIFT,
471 D3DSPSM_DZ = 9 << D3DSP_SRCMOD_SHIFT,
472 D3DSPSM_DW = 10 << D3DSP_SRCMOD_SHIFT,
473 D3DSPSM_FORCE_DWORD = 0x7FFFFFFF
474 } D3DSHADER_PARAM_SRCMOD_TYPE;
476 #define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
477 #define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
478 #define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
479 #define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
481 #define D3DSI_COMMENTSIZE_SHIFT 16
482 #define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
484 #define D3DSHADER_COMMENT(commentSize) \
485 ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
487 #define D3DPS_END() 0x0000FFFF
488 #define D3DVS_END() 0x0000FFFF
491 /*****************************************************************************
492 * Direct 3D v8 enumerated types
494 typedef enum _D3DBACKBUFFER_TYPE {
495 D3DBACKBUFFER_TYPE_MONO = 0,
496 D3DBACKBUFFER_TYPE_LEFT = 1,
497 D3DBACKBUFFER_TYPE_RIGHT = 2,
499 D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
500 } D3DBACKBUFFER_TYPE;
502 typedef enum _D3DBASISTYPE{
503 D3DBASIS_BEZIER = 0,
504 D3DBASIS_BSPLINE = 1,
505 D3DBASIS_INTERPOLATE = 2,
507 D3DBASIS_FORCE_DWORD = 0x7fffffff
508 } D3DBASISTYPE;
510 typedef enum _D3DBLEND {
511 D3DBLEND_ZERO = 1,
512 D3DBLEND_ONE = 2,
513 D3DBLEND_SRCCOLOR = 3,
514 D3DBLEND_INVSRCCOLOR = 4,
515 D3DBLEND_SRCALPHA = 5,
516 D3DBLEND_INVSRCALPHA = 6,
517 D3DBLEND_DESTALPHA = 7,
518 D3DBLEND_INVDESTALPHA = 8,
519 D3DBLEND_DESTCOLOR = 9,
520 D3DBLEND_INVDESTCOLOR = 10,
521 D3DBLEND_SRCALPHASAT = 11,
522 D3DBLEND_BOTHSRCALPHA = 12,
523 D3DBLEND_BOTHINVSRCALPHA = 13,
525 D3DBLEND_FORCE_DWORD = 0x7fffffff
526 } D3DBLEND;
528 typedef enum _D3DBLENDOP {
529 D3DBLENDOP_ADD = 1,
530 D3DBLENDOP_SUBTRACT = 2,
531 D3DBLENDOP_REVSUBTRACT = 3,
532 D3DBLENDOP_MIN = 4,
533 D3DBLENDOP_MAX = 5,
535 D3DBLENDOP_FORCE_DWORD = 0x7fffffff
536 } D3DBLENDOP;
538 typedef enum _D3DCMPFUNC {
539 D3DCMP_NEVER = 1,
540 D3DCMP_LESS = 2,
541 D3DCMP_EQUAL = 3,
542 D3DCMP_LESSEQUAL = 4,
543 D3DCMP_GREATER = 5,
544 D3DCMP_NOTEQUAL = 6,
545 D3DCMP_GREATEREQUAL = 7,
546 D3DCMP_ALWAYS = 8,
548 D3DCMP_FORCE_DWORD = 0x7fffffff
549 } D3DCMPFUNC;
551 typedef enum _D3DCUBEMAP_FACES {
552 D3DCUBEMAP_FACE_POSITIVE_X = 0,
553 D3DCUBEMAP_FACE_NEGATIVE_X = 1,
554 D3DCUBEMAP_FACE_POSITIVE_Y = 2,
555 D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
556 D3DCUBEMAP_FACE_POSITIVE_Z = 4,
557 D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
559 D3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff
560 } D3DCUBEMAP_FACES;
562 typedef enum _D3DCULL {
563 D3DCULL_NONE = 1,
564 D3DCULL_CW = 2,
565 D3DCULL_CCW = 3,
567 D3DCULL_FORCE_DWORD = 0x7fffffff
568 } D3DCULL;
570 typedef enum _D3DDEBUGMONITORTOKENS {
571 D3DDMT_ENABLE = 0,
572 D3DDMT_DISABLE = 1,
574 D3DDMT_FORCE_DWORD = 0x7fffffff
575 } D3DDEBUGMONITORTOKENS;
577 typedef enum _D3DDEVTYPE {
578 D3DDEVTYPE_HAL = 1,
579 D3DDEVTYPE_REF = 2,
580 D3DDEVTYPE_SW = 3,
582 D3DDEVTYPE_FORCE_DWORD = 0xffffffff
583 } D3DDEVTYPE;
585 typedef enum _D3DFILLMODE {
586 D3DFILL_POINT = 1,
587 D3DFILL_WIREFRAME = 2,
588 D3DFILL_SOLID = 3,
590 D3DFILL_FORCE_DWORD = 0x7fffffff
591 } D3DFILLMODE;
593 typedef enum _D3DFOGMODE {
594 D3DFOG_NONE = 0,
595 D3DFOG_EXP = 1,
596 D3DFOG_EXP2 = 2,
597 D3DFOG_LINEAR = 3,
599 D3DFOG_FORCE_DWORD = 0x7fffffff
600 } D3DFOGMODE;
602 typedef enum _D3DFORMAT {
603 D3DFMT_UNKNOWN = 0,
605 D3DFMT_R8G8B8 = 20,
606 D3DFMT_A8R8G8B8 = 21,
607 D3DFMT_X8R8G8B8 = 22,
608 D3DFMT_R5G6B5 = 23,
609 D3DFMT_X1R5G5B5 = 24,
610 D3DFMT_A1R5G5B5 = 25,
611 D3DFMT_A4R4G4B4 = 26,
612 D3DFMT_R3G3B2 = 27,
613 D3DFMT_A8 = 28,
614 D3DFMT_A8R3G3B2 = 29,
615 D3DFMT_X4R4G4B4 = 30,
617 D3DFMT_A8P8 = 40,
618 D3DFMT_P8 = 41,
620 D3DFMT_L8 = 50,
621 D3DFMT_A8L8 = 51,
622 D3DFMT_A4L4 = 52,
624 D3DFMT_V8U8 = 60,
625 D3DFMT_L6V5U5 = 61,
626 D3DFMT_X8L8V8U8 = 62,
627 D3DFMT_Q8W8V8U8 = 63,
628 D3DFMT_V16U16 = 64,
629 D3DFMT_W11V11U10 = 65,
631 D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
632 D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
633 D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
634 D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
635 D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
636 D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
637 D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
639 D3DFMT_D16_LOCKABLE = 70,
640 D3DFMT_D32 = 71,
641 D3DFMT_D15S1 = 73,
642 D3DFMT_D24S8 = 75,
643 D3DFMT_D16 = 80,
644 D3DFMT_D24X8 = 77,
645 D3DFMT_D24X4S4 = 79,
647 D3DFMT_VERTEXDATA = 100,
648 D3DFMT_INDEX16 = 101,
649 D3DFMT_INDEX32 = 102,
651 D3DFMT_FORCE_DWORD = 0xFFFFFFFF
652 } D3DFORMAT;
654 typedef enum _D3DLIGHTTYPE {
655 D3DLIGHT_POINT = 1,
656 D3DLIGHT_SPOT = 2,
657 D3DLIGHT_DIRECTIONAL = 3,
659 D3DLIGHT_FORCE_DWORD = 0x7fffffff
660 } D3DLIGHTTYPE;
662 typedef enum _D3DMATERIALCOLORSOURCE {
663 D3DMCS_MATERIAL = 0,
664 D3DMCS_COLOR1 = 1,
665 D3DMCS_COLOR2 = 2,
667 D3DMCS_FORCE_DWORD = 0x7fffffff
668 } D3DMATERIALCOLORSOURCE;
670 typedef enum _D3DMULTISAMPLE_TYPE {
671 D3DMULTISAMPLE_NONE = 0,
672 D3DMULTISAMPLE_2_SAMPLES = 2,
673 D3DMULTISAMPLE_3_SAMPLES = 3,
674 D3DMULTISAMPLE_4_SAMPLES = 4,
675 D3DMULTISAMPLE_5_SAMPLES = 5,
676 D3DMULTISAMPLE_6_SAMPLES = 6,
677 D3DMULTISAMPLE_7_SAMPLES = 7,
678 D3DMULTISAMPLE_8_SAMPLES = 8,
679 D3DMULTISAMPLE_9_SAMPLES = 9,
680 D3DMULTISAMPLE_10_SAMPLES = 10,
681 D3DMULTISAMPLE_11_SAMPLES = 11,
682 D3DMULTISAMPLE_12_SAMPLES = 12,
683 D3DMULTISAMPLE_13_SAMPLES = 13,
684 D3DMULTISAMPLE_14_SAMPLES = 14,
685 D3DMULTISAMPLE_15_SAMPLES = 15,
686 D3DMULTISAMPLE_16_SAMPLES = 16,
688 D3DMULTISAMPLE_FORCE_DWORD = 0xffffffff
689 } D3DMULTISAMPLE_TYPE;
691 typedef enum _D3DORDERTYPE {
692 D3DORDER_LINEAR = 1,
693 D3DORDER_QUADRATIC = 2,
694 D3DORDER_CUBIC = 3,
695 D3DORDER_QUINTIC = 5,
697 D3DORDER_FORCE_DWORD = 0x7fffffff
698 } D3DORDERTYPE;
700 typedef enum _D3DPATCHEDGESTYLE {
701 D3DPATCHEDGE_DISCRETE = 0,
702 D3DPATCHEDGE_CONTINUOUS = 1,
704 D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
705 } D3DPATCHEDGESTYLE;
707 typedef enum _D3DPOOL {
708 D3DPOOL_DEFAULT = 0,
709 D3DPOOL_MANAGED = 1,
710 D3DPOOL_SYSTEMMEM = 2,
711 D3DPOOL_SCRATCH = 3,
713 D3DPOOL_FORCE_DWORD = 0x7fffffff
714 } D3DPOOL;
716 typedef enum _D3DPRIMITIVETYPE {
717 D3DPT_POINTLIST = 1,
718 D3DPT_LINELIST = 2,
719 D3DPT_LINESTRIP = 3,
720 D3DPT_TRIANGLELIST = 4,
721 D3DPT_TRIANGLESTRIP = 5,
722 D3DPT_TRIANGLEFAN = 6,
724 D3DPT_FORCE_DWORD = 0x7fffffff
725 } D3DPRIMITIVETYPE;
727 typedef enum _D3DRENDERSTATETYPE {
728 D3DRS_ZENABLE = 7,
729 D3DRS_FILLMODE = 8,
730 D3DRS_SHADEMODE = 9,
731 D3DRS_LINEPATTERN = 10,
732 D3DRS_ZWRITEENABLE = 14,
733 D3DRS_ALPHATESTENABLE = 15,
734 D3DRS_LASTPIXEL = 16,
735 D3DRS_SRCBLEND = 19,
736 D3DRS_DESTBLEND = 20,
737 D3DRS_CULLMODE = 22,
738 D3DRS_ZFUNC = 23,
739 D3DRS_ALPHAREF = 24,
740 D3DRS_ALPHAFUNC = 25,
741 D3DRS_DITHERENABLE = 26,
742 D3DRS_ALPHABLENDENABLE = 27,
743 D3DRS_FOGENABLE = 28,
744 D3DRS_SPECULARENABLE = 29,
745 D3DRS_ZVISIBLE = 30,
746 D3DRS_FOGCOLOR = 34,
747 D3DRS_FOGTABLEMODE = 35,
748 D3DRS_FOGSTART = 36,
749 D3DRS_FOGEND = 37,
750 D3DRS_FOGDENSITY = 38,
751 D3DRS_EDGEANTIALIAS = 40,
752 D3DRS_ZBIAS = 47,
753 D3DRS_RANGEFOGENABLE = 48,
754 D3DRS_STENCILENABLE = 52,
755 D3DRS_STENCILFAIL = 53,
756 D3DRS_STENCILZFAIL = 54,
757 D3DRS_STENCILPASS = 55,
758 D3DRS_STENCILFUNC = 56,
759 D3DRS_STENCILREF = 57,
760 D3DRS_STENCILMASK = 58,
761 D3DRS_STENCILWRITEMASK = 59,
762 D3DRS_TEXTUREFACTOR = 60,
763 D3DRS_WRAP0 = 128,
764 D3DRS_WRAP1 = 129,
765 D3DRS_WRAP2 = 130,
766 D3DRS_WRAP3 = 131,
767 D3DRS_WRAP4 = 132,
768 D3DRS_WRAP5 = 133,
769 D3DRS_WRAP6 = 134,
770 D3DRS_WRAP7 = 135,
771 D3DRS_CLIPPING = 136,
772 D3DRS_LIGHTING = 137,
773 D3DRS_AMBIENT = 139,
774 D3DRS_FOGVERTEXMODE = 140,
775 D3DRS_COLORVERTEX = 141,
776 D3DRS_LOCALVIEWER = 142,
777 D3DRS_NORMALIZENORMALS = 143,
778 D3DRS_DIFFUSEMATERIALSOURCE = 145,
779 D3DRS_SPECULARMATERIALSOURCE = 146,
780 D3DRS_AMBIENTMATERIALSOURCE = 147,
781 D3DRS_EMISSIVEMATERIALSOURCE = 148,
782 D3DRS_VERTEXBLEND = 151,
783 D3DRS_CLIPPLANEENABLE = 152,
784 D3DRS_SOFTWAREVERTEXPROCESSING = 153,
785 D3DRS_POINTSIZE = 154,
786 D3DRS_POINTSIZE_MIN = 155,
787 D3DRS_POINTSPRITEENABLE = 156,
788 D3DRS_POINTSCALEENABLE = 157,
789 D3DRS_POINTSCALE_A = 158,
790 D3DRS_POINTSCALE_B = 159,
791 D3DRS_POINTSCALE_C = 160,
792 D3DRS_MULTISAMPLEANTIALIAS = 161,
793 D3DRS_MULTISAMPLEMASK = 162,
794 D3DRS_PATCHEDGESTYLE = 163,
795 D3DRS_PATCHSEGMENTS = 164,
796 D3DRS_DEBUGMONITORTOKEN = 165,
797 D3DRS_POINTSIZE_MAX = 166,
798 D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
799 D3DRS_COLORWRITEENABLE = 168,
800 D3DRS_TWEENFACTOR = 170,
801 D3DRS_BLENDOP = 171,
802 D3DRS_POSITIONORDER = 172,
803 D3DRS_NORMALORDER = 173,
805 D3DRS_FORCE_DWORD = 0x7fffffff
806 } D3DRENDERSTATETYPE;
808 typedef enum _D3DRESOURCETYPE {
809 D3DRTYPE_SURFACE = 1,
810 D3DRTYPE_VOLUME = 2,
811 D3DRTYPE_TEXTURE = 3,
812 D3DRTYPE_VOLUMETEXTURE = 4,
813 D3DRTYPE_CUBETEXTURE = 5,
814 D3DRTYPE_VERTEXBUFFER = 6,
815 D3DRTYPE_INDEXBUFFER = 7,
817 D3DRTYPE_FORCE_DWORD = 0x7fffffff
818 } D3DRESOURCETYPE;
820 typedef enum _D3DSHADEMODE {
821 D3DSHADE_FLAT = 1,
822 D3DSHADE_GOURAUD = 2,
823 D3DSHADE_PHONG = 3,
825 D3DSHADE_FORCE_DWORD = 0x7fffffff
826 } D3DSHADEMODE;
828 typedef enum _D3DSTATEBLOCKTYPE {
829 D3DSBT_ALL = 1,
830 D3DSBT_PIXELSTATE = 2,
831 D3DSBT_VERTEXSTATE = 3,
833 D3DSBT_FORCE_DWORD = 0xffffffff
834 } D3DSTATEBLOCKTYPE;
836 typedef enum _D3DSTENCILOP {
837 D3DSTENCILOP_KEEP = 1,
838 D3DSTENCILOP_ZERO = 2,
839 D3DSTENCILOP_REPLACE = 3,
840 D3DSTENCILOP_INCRSAT = 4,
841 D3DSTENCILOP_DECRSAT = 5,
842 D3DSTENCILOP_INVERT = 6,
843 D3DSTENCILOP_INCR = 7,
844 D3DSTENCILOP_DECR = 8,
846 D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
847 } D3DSTENCILOP;
849 typedef enum _D3DSWAPEFFECT {
850 D3DSWAPEFFECT_DISCARD = 1,
851 D3DSWAPEFFECT_FLIP = 2,
852 D3DSWAPEFFECT_COPY = 3,
853 D3DSWAPEFFECT_COPY_VSYNC = 4,
855 D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
856 } D3DSWAPEFFECT;
858 typedef enum _D3DTEXTUREADDRESS {
859 D3DTADDRESS_WRAP = 1,
860 D3DTADDRESS_MIRROR = 2,
861 D3DTADDRESS_CLAMP = 3,
862 D3DTADDRESS_BORDER = 4,
863 D3DTADDRESS_MIRRORONCE = 5,
865 D3DTADDRESS_FORCE_DWORD = 0x7fffffff
866 } D3DTEXTUREADDRESS;
868 typedef enum _D3DTEXTUREFILTERTYPE {
869 D3DTEXF_NONE = 0,
870 D3DTEXF_POINT = 1,
871 D3DTEXF_LINEAR = 2,
872 D3DTEXF_ANISOTROPIC = 3,
873 D3DTEXF_FLATCUBIC = 4,
874 D3DTEXF_GAUSSIANCUBIC = 5,
876 D3DTEXF_FORCE_DWORD = 0x7fffffff
877 } D3DTEXTUREFILTERTYPE;
879 typedef enum _D3DTEXTUREOP {
880 D3DTOP_DISABLE = 1,
881 D3DTOP_SELECTARG1 = 2,
882 D3DTOP_SELECTARG2 = 3,
883 D3DTOP_MODULATE = 4,
884 D3DTOP_MODULATE2X = 5,
885 D3DTOP_MODULATE4X = 6,
886 D3DTOP_ADD = 7,
887 D3DTOP_ADDSIGNED = 8,
888 D3DTOP_ADDSIGNED2X = 9,
889 D3DTOP_SUBTRACT = 10,
890 D3DTOP_ADDSMOOTH = 11,
891 D3DTOP_BLENDDIFFUSEALPHA = 12,
892 D3DTOP_BLENDTEXTUREALPHA = 13,
893 D3DTOP_BLENDFACTORALPHA = 14,
894 D3DTOP_BLENDTEXTUREALPHAPM = 15,
895 D3DTOP_BLENDCURRENTALPHA = 16,
896 D3DTOP_PREMODULATE = 17,
897 D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
898 D3DTOP_MODULATECOLOR_ADDALPHA = 19,
899 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
900 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
901 D3DTOP_BUMPENVMAP = 22,
902 D3DTOP_BUMPENVMAPLUMINANCE = 23,
903 D3DTOP_DOTPRODUCT3 = 24,
904 D3DTOP_MULTIPLYADD = 25,
905 D3DTOP_LERP = 26,
907 D3DTOP_FORCE_DWORD = 0x7fffffff,
908 } D3DTEXTUREOP;
910 typedef enum _D3DTEXTURESTAGESTATETYPE {
911 D3DTSS_COLOROP = 1,
912 D3DTSS_COLORARG1 = 2,
913 D3DTSS_COLORARG2 = 3,
914 D3DTSS_ALPHAOP = 4,
915 D3DTSS_ALPHAARG1 = 5,
916 D3DTSS_ALPHAARG2 = 6,
917 D3DTSS_BUMPENVMAT00 = 7,
918 D3DTSS_BUMPENVMAT01 = 8,
919 D3DTSS_BUMPENVMAT10 = 9,
920 D3DTSS_BUMPENVMAT11 = 10,
921 D3DTSS_TEXCOORDINDEX = 11,
922 D3DTSS_ADDRESSU = 13,
923 D3DTSS_ADDRESSV = 14,
924 D3DTSS_BORDERCOLOR = 15,
925 D3DTSS_MAGFILTER = 16,
926 D3DTSS_MINFILTER = 17,
927 D3DTSS_MIPFILTER = 18,
928 D3DTSS_MIPMAPLODBIAS = 19,
929 D3DTSS_MAXMIPLEVEL = 20,
930 D3DTSS_MAXANISOTROPY = 21,
931 D3DTSS_BUMPENVLSCALE = 22,
932 D3DTSS_BUMPENVLOFFSET = 23,
933 D3DTSS_TEXTURETRANSFORMFLAGS = 24,
934 D3DTSS_ADDRESSW = 25,
935 D3DTSS_COLORARG0 = 26,
936 D3DTSS_ALPHAARG0 = 27,
937 D3DTSS_RESULTARG = 28,
939 D3DTSS_FORCE_DWORD = 0x7fffffff
940 } D3DTEXTURESTAGESTATETYPE;
942 typedef enum _D3DTEXTURETRANSFORMFLAGS {
943 D3DTTFF_DISABLE = 0,
944 D3DTTFF_COUNT1 = 1,
945 D3DTTFF_COUNT2 = 2,
946 D3DTTFF_COUNT3 = 3,
947 D3DTTFF_COUNT4 = 4,
948 D3DTTFF_PROJECTED = 256,
950 D3DTTFF_FORCE_DWORD = 0x7fffffff
951 } D3DTEXTURETRANSFORMFLAGS;
953 typedef enum _D3DTRANSFORMSTATETYPE {
954 D3DTS_VIEW = 2,
955 D3DTS_PROJECTION = 3,
956 D3DTS_TEXTURE0 = 16,
957 D3DTS_TEXTURE1 = 17,
958 D3DTS_TEXTURE2 = 18,
959 D3DTS_TEXTURE3 = 19,
960 D3DTS_TEXTURE4 = 20,
961 D3DTS_TEXTURE5 = 21,
962 D3DTS_TEXTURE6 = 22,
963 D3DTS_TEXTURE7 = 23,
965 D3DTS_FORCE_DWORD = 0x7fffffff
966 } D3DTRANSFORMSTATETYPE;
968 typedef enum _D3DVERTEXBLENDFLAGS {
969 D3DVBF_DISABLE = 0,
970 D3DVBF_1WEIGHTS = 1,
971 D3DVBF_2WEIGHTS = 2,
972 D3DVBF_3WEIGHTS = 3,
973 D3DVBF_TWEENING = 255,
974 D3DVBF_0WEIGHTS = 256
975 } D3DVERTEXBLENDFLAGS;
977 typedef enum _D3DZBUFFERTYPE {
978 D3DZB_FALSE = 0,
979 D3DZB_TRUE = 1,
980 D3DZB_USEW = 2,
982 D3DZB_FORCE_DWORD = 0x7fffffff
983 } D3DZBUFFERTYPE;
986 /*****************************************************************************
987 * Direct 3D v8 typedefs
989 typedef DWORD D3DCOLOR;
991 /*****************************************************************************
992 * Direct 3D v8 structures
994 typedef struct _D3DADAPTER_IDENTIFIER8 {
995 char Driver[MAX_DEVICE_IDENTIFIER_STRING];
996 char Description[MAX_DEVICE_IDENTIFIER_STRING];
998 LARGE_INTEGER DriverVersion;
999 DWORD VendorId;
1000 DWORD DeviceId;
1001 DWORD SubSysId;
1002 DWORD Revision;
1004 GUID DeviceIdentifier;
1006 DWORD WHQLLevel;
1007 } D3DADAPTER_IDENTIFIER8;
1009 typedef struct _D3DBOX {
1010 UINT Left;
1011 UINT Top;
1012 UINT Right;
1013 UINT Bottom;
1014 UINT Front;
1015 UINT Back;
1016 } D3DBOX;
1018 typedef struct _D3DCLIPSTATUS8 {
1019 DWORD ClipUnion;
1020 DWORD ClipIntersection;
1021 } D3DCLIPSTATUS8;
1023 typedef struct _D3DCOLORVALUE {
1024 float r;
1025 float g;
1026 float b;
1027 float a;
1028 } D3DCOLORVALUE;
1030 typedef struct _D3DDEVICE_CREATION_PARAMETERS {
1031 UINT AdapterOrdinal;
1032 D3DDEVTYPE DeviceType;
1033 HWND hFocusWindow;
1034 DWORD BehaviorFlags;
1035 } D3DDEVICE_CREATION_PARAMETERS;
1037 typedef struct _D3DDISPLAYMODE {
1038 UINT Width;
1039 UINT Height;
1040 UINT RefreshRate;
1041 D3DFORMAT Format;
1042 } D3DDISPLAYMODE;
1044 typedef struct _D3DGAMMARAMP {
1045 WORD red [256];
1046 WORD green[256];
1047 WORD blue [256];
1048 } D3DGAMMARAMP;
1050 typedef struct _D3DINDEXBUFFER_DESC {
1051 D3DFORMAT Format;
1052 D3DRESOURCETYPE Type;
1053 DWORD Usage;
1054 D3DPOOL Pool;
1055 UINT Size;
1056 } D3DINDEXBUFFER_DESC;
1058 typedef struct _D3DVECTOR {
1059 float x;
1060 float y;
1061 float z;
1062 } D3DVECTOR;
1064 typedef struct _D3DLIGHT8 {
1065 D3DLIGHTTYPE Type;
1066 D3DCOLORVALUE Diffuse;
1067 D3DCOLORVALUE Specular;
1068 D3DCOLORVALUE Ambient;
1069 D3DVECTOR Position;
1070 D3DVECTOR Direction;
1071 float Range;
1072 float Falloff;
1073 float Attenuation0;
1074 float Attenuation1;
1075 float Attenuation2;
1076 float Theta;
1077 float Phi;
1078 } D3DLIGHT8;
1080 typedef struct _D3DLINEPATTERN {
1081 WORD wRepeatFactor;
1082 WORD wLinePattern;
1083 } D3DLINEPATTERN;
1085 typedef struct _D3DLOCKED_BOX {
1086 INT RowPitch;
1087 INT SlicePitch;
1088 void* pBits;
1089 } D3DLOCKED_BOX;
1091 typedef struct _D3DLOCKED_RECT {
1092 INT Pitch;
1093 void* pBits;
1094 } D3DLOCKED_RECT;
1096 typedef struct _D3DMATERIAL8 {
1097 D3DCOLORVALUE Diffuse;
1098 D3DCOLORVALUE Ambient;
1099 D3DCOLORVALUE Specular;
1100 D3DCOLORVALUE Emissive;
1101 float Power;
1102 } D3DMATERIAL8;
1104 typedef struct _D3DMATRIX {
1105 union {
1106 struct {
1107 float _11, _12, _13, _14;
1108 float _21, _22, _23, _24;
1109 float _31, _32, _33, _34;
1110 float _41, _42, _43, _44;
1111 } DUMMYSTRUCTNAME;
1112 float m[4][4];
1113 } DUMMYUNIONNAME;
1114 } D3DMATRIX;
1116 typedef struct _D3DPRESENT_PARAMETERS_ {
1117 UINT BackBufferWidth;
1118 UINT BackBufferHeight;
1119 D3DFORMAT BackBufferFormat;
1120 UINT BackBufferCount;
1122 D3DMULTISAMPLE_TYPE MultiSampleType;
1124 D3DSWAPEFFECT SwapEffect;
1125 HWND hDeviceWindow;
1126 BOOL Windowed;
1127 BOOL EnableAutoDepthStencil;
1128 D3DFORMAT AutoDepthStencilFormat;
1129 DWORD Flags;
1131 UINT FullScreen_RefreshRateInHz;
1132 UINT FullScreen_PresentationInterval;
1134 } D3DPRESENT_PARAMETERS;
1136 typedef struct _D3DRANGE {
1137 UINT Offset;
1138 UINT Size;
1139 } D3DRANGE;
1141 typedef struct _D3DRASTER_STATUS {
1142 BOOL InVBlank;
1143 UINT ScanLine;
1144 } D3DRASTER_STATUS;
1146 typedef struct _D3DRECT {
1147 LONG x1;
1148 LONG y1;
1149 LONG x2;
1150 LONG y2;
1151 } D3DRECT;
1153 typedef struct _D3DRECTPATCH_INFO {
1154 UINT StartVertexOffsetWidth;
1155 UINT StartVertexOffsetHeight;
1156 UINT Width;
1157 UINT Height;
1158 UINT Stride;
1159 D3DBASISTYPE Basis;
1160 D3DORDERTYPE Order;
1161 } D3DRECTPATCH_INFO;
1163 typedef struct _D3DSURFACE_DESC {
1164 D3DFORMAT Format;
1165 D3DRESOURCETYPE Type;
1166 DWORD Usage;
1167 D3DPOOL Pool;
1168 UINT Size;
1169 D3DMULTISAMPLE_TYPE MultiSampleType;
1170 UINT Width;
1171 UINT Height;
1172 } D3DSURFACE_DESC;
1174 typedef struct _D3DTRIPATCH_INFO {
1175 UINT StartVertexOffset;
1176 UINT NumVertices;
1177 D3DBASISTYPE Basis;
1178 D3DORDERTYPE Order;
1179 } D3DTRIPATCH_INFO;
1181 typedef struct _D3DVERTEXBUFFER_DESC {
1182 D3DFORMAT Format;
1183 D3DRESOURCETYPE Type;
1184 DWORD Usage;
1185 D3DPOOL Pool;
1186 UINT Size;
1187 DWORD FVF;
1188 } D3DVERTEXBUFFER_DESC;
1190 typedef struct _D3DVIEWPORT8 {
1191 DWORD X;
1192 DWORD Y;
1193 DWORD Width;
1194 DWORD Height;
1195 float MinZ;
1196 float MaxZ;
1197 } D3DVIEWPORT8;
1199 typedef struct _D3DVOLUME_DESC {
1200 D3DFORMAT Format;
1201 D3DRESOURCETYPE Type;
1202 DWORD Usage;
1203 D3DPOOL Pool;
1204 UINT Size;
1205 UINT Width;
1206 UINT Height;
1207 UINT Depth;
1208 } D3DVOLUME_DESC;
1210 #endif /* __WINE_D3D8TYPES_H */