Release 20030408.
[wine/gsoc-2012-control.git] / include / d3d8types.h
blob20fea1f5b6a7f74d0046756082ff63f6432eb09a
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 MAKEFOURCC(ch0, ch1, ch2, ch3) \
151 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
152 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
155 /****************************
156 * Vertex Shaders Declaration
159 typedef enum _D3DVSD_TOKENTYPE {
160 D3DVSD_TOKEN_NOP = 0,
161 D3DVSD_TOKEN_STREAM = 1,
162 D3DVSD_TOKEN_STREAMDATA = 2,
163 D3DVSD_TOKEN_TESSELLATOR = 3,
164 D3DVSD_TOKEN_CONSTMEM = 4,
165 D3DVSD_TOKEN_EXT = 5,
166 /* RESERVED = 6 */
167 D3DVSD_TOKEN_END = 7,
168 D3DVSD_FORCE_DWORD = 0x7FFFFFFF
169 } D3DVSD_TOKENTYPE;
171 /** input registers for vertes shaders functions */
173 #define D3DVSDE_POSITION 0
174 #define D3DVSDE_BLENDWEIGHT 1
175 #define D3DVSDE_BLENDINDICES 2
176 #define D3DVSDE_NORMAL 3
177 #define D3DVSDE_PSIZE 4
178 #define D3DVSDE_DIFFUSE 5
179 #define D3DVSDE_SPECULAR 6
180 #define D3DVSDE_TEXCOORD0 7
181 #define D3DVSDE_TEXCOORD1 8
182 #define D3DVSDE_TEXCOORD2 9
183 #define D3DVSDE_TEXCOORD3 10
184 #define D3DVSDE_TEXCOORD4 11
185 #define D3DVSDE_TEXCOORD5 12
186 #define D3DVSDE_TEXCOORD6 13
187 #define D3DVSDE_TEXCOORD7 14
188 #define D3DVSDE_POSITION2 15
189 #define D3DVSDE_NORMAL2 16
191 /** Address of the vertex register. 0 - 16 */
192 typedef enum _D3DVSDE_REGISTER {
193 D3DVSDE_POSITION = 0,
194 D3DVSDE_BLENDWEIGHT = 1,
195 D3DVSDE_BLENDINDICES = 2,
196 D3DVSDE_NORMAL = 3,
197 D3DVSDE_PSIZE = 4,
198 D3DVSDE_DIFFUSE = 5,
199 D3DVSDE_SPECULAR = 6,
200 D3DVSDE_TEXCOORD0 = 7,
201 D3DVSDE_TEXCOORD1 = 8,
202 D3DVSDE_TEXCOORD2 = 9,
203 D3DVSDE_TEXCOORD3 = 10,
204 D3DVSDE_TEXCOORD4 = 11,
205 D3DVSDE_TEXCOORD5 = 12,
206 D3DVSDE_TEXCOORD6 = 13,
207 D3DVSDE_TEXCOORD7 = 14,
208 D3DVSDE_POSITION2 = 15,
209 D3DVSDE_NORMAL2 = 16
210 } D3DVSDE_REGISTER;
212 /** bit-field declaration for VertexRegister Type */
214 #define D3DVSDT_FLOAT1 0x00
215 #define D3DVSDT_FLOAT2 0x01
216 #define D3DVSDT_FLOAT3 0x02
217 #define D3DVSDT_FLOAT4 0x03
218 #define D3DVSDT_D3DCOLOR 0x04
219 #define D3DVSDT_UBYTE4 0x05
220 #define D3DVSDT_SHORT2 0x06
221 #define D3DVSDT_SHORT4 0x07
223 typedef enum _D3DVSDT_TYPE {
224 D3DVSDT_FLOAT1 = 0x00,
225 D3DVSDT_FLOAT2 = 0x01,
226 D3DVSDT_FLOAT3 = 0x02,
227 D3DVSDT_FLOAT4 = 0x03,
228 D3DVSDT_D3DCOLOR = 0x04,
229 D3DVSDT_UBYTE4 = 0x05,
230 D3DVSDT_SHORT2 = 0x06,
231 D3DVSDT_SHORT4 = 0x07
232 } D3DVSDT_TYPE;
235 #define D3DVSD_CONSTADDRESSSHIFT 0
236 #define D3DVSD_EXTINFOSHIFT 0
237 #define D3DVSD_STREAMNUMBERSHIFT 0
238 #define D3DVSD_VERTEXREGSHIFT 0
239 #define D3DVSD_CONSTRSSHIFT 16
240 #define D3DVSD_DATATYPESHIFT 16
241 #define D3DVSD_SKIPCOUNTSHIFT 16
242 #define D3DVSD_VERTEXREGINSHIFT 20
243 #define D3DVSD_EXTCOUNTSHIFT 24
244 #define D3DVSD_CONSTCOUNTSHIFT 25
245 #define D3DVSD_DATALOADTYPESHIFT 28
246 #define D3DVSD_STREAMTESSSHIFT 28
247 #define D3DVSD_TOKENTYPESHIFT 29
249 #define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT)
250 #define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT)
251 #define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT)
252 #define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT)
253 #define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT)
254 #define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT)
255 #define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT)
256 #define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT)
257 #define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT)
258 #define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT)
259 #define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT)
260 #define D3DVSD_STREAMTESSMASK (0x1 << D3DVSD_STREAMTESSSHIFT)
261 #define D3DVSD_TOKENTYPEMASK (0x7 << D3DVSD_TOKENTYPESHIFT)
264 #define D3DVSD_MAKETOKENTYPE(TokenType) \
265 ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
267 #define D3DVSD_CONST(ConstantAddress, Count) \
268 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
270 #define D3DVSD_END() 0xFFFFFFFF
272 #define D3DVSD_NOP() 0x00000000
274 #define D3DVSD_REG(VertexRegister, Type) \
275 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
277 #define D3DVSD_SKIP(Count) \
278 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
280 #define D3DVSD_STREAM(StreamNumber) \
281 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
283 #define D3DVSD_STREAM_TESS() \
284 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
286 #define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
287 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
289 #define D3DVSD_TESSUV(Register) \
290 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
293 /********************************
294 * Pixel/Vertex Shaders Functions
297 /** Maximum number of supported texture coordinates sets operation */
298 #define D3DDP_MAXTEXCOORD 8
300 /** opcode token mask */
301 #define D3DSI_OPCODE_MASK 0x0000FFFF
303 /** opcodes types for PS and VS */
304 typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
305 D3DSIO_NOP = 0,
306 D3DSIO_MOV = 1,
307 D3DSIO_ADD = 2,
308 D3DSIO_SUB = 3,
309 D3DSIO_MAD = 4,
310 D3DSIO_MUL = 5,
311 D3DSIO_RCP = 6,
312 D3DSIO_RSQ = 7,
313 D3DSIO_DP3 = 8,
314 D3DSIO_DP4 = 9,
315 D3DSIO_MIN = 10,
316 D3DSIO_MAX = 11,
317 D3DSIO_SLT = 12,
318 D3DSIO_SGE = 13,
319 D3DSIO_EXP = 14,
320 D3DSIO_LOG = 15,
321 D3DSIO_LIT = 16,
322 D3DSIO_DST = 17,
323 D3DSIO_LRP = 18,
324 D3DSIO_FRC = 19,
325 D3DSIO_M4x4 = 20,
326 D3DSIO_M4x3 = 21,
327 D3DSIO_M3x4 = 22,
328 D3DSIO_M3x3 = 23,
329 D3DSIO_M3x2 = 24,
331 D3DSIO_TEXCOORD = 64,
332 D3DSIO_TEXKILL = 65,
333 D3DSIO_TEX = 66,
334 D3DSIO_TEXBEM = 67,
335 D3DSIO_TEXBEML = 68,
336 D3DSIO_TEXREG2AR = 69,
337 D3DSIO_TEXREG2GB = 70,
338 D3DSIO_TEXM3x2PAD = 71,
339 D3DSIO_TEXM3x2TEX = 72,
340 D3DSIO_TEXM3x3PAD = 73,
341 D3DSIO_TEXM3x3TEX = 74,
342 D3DSIO_TEXM3x3DIFF = 75,
343 D3DSIO_TEXM3x3SPEC = 76,
344 D3DSIO_TEXM3x3VSPEC = 77,
345 D3DSIO_EXPP = 78,
346 D3DSIO_LOGP = 79,
347 D3DSIO_CND = 80,
348 D3DSIO_DEF = 81,
349 D3DSIO_TEXREG2RGB = 82,
350 D3DSIO_TEXDP3TEX = 83,
351 D3DSIO_TEXM3x2DEPTH = 84,
352 D3DSIO_TEXDP3 = 85,
353 D3DSIO_TEXM3x3 = 86,
354 D3DSIO_TEXDEPTH = 87,
355 D3DSIO_CMP = 88,
356 D3DSIO_BEM = 89,
358 D3DSIO_PHASE = 0xFFFD,
359 D3DSIO_COMMENT = 0xFFFE,
360 D3DSIO_END = 0XFFFF,
362 D3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */
363 } D3DSHADER_INSTRUCTION_OPCODE_TYPE;
365 /** for parallelism */
366 #define D3DSI_COISSUE 0x40000000
368 /** destination parameter modifiers (.xyzw) */
369 #define D3DSP_WRITEMASK_0 0x00010000 /* .x r */
370 #define D3DSP_WRITEMASK_1 0x00020000 /* .y g */
371 #define D3DSP_WRITEMASK_2 0x00040000 /* .z b */
372 #define D3DSP_WRITEMASK_3 0x00080000 /* .w a */
373 #define D3DSP_WRITEMASK_ALL 0x000F0000 /* all */
375 #define D3DSP_DSTMOD_SHIFT 20
376 #define D3DSP_DSTMOD_MASK (0xF << D3DSP_DSTMOD_SHIFT)
378 typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
379 D3DSPDM_NONE = 0 << D3DSP_DSTMOD_SHIFT,
380 D3DSPDM_SATURATE = 1 << D3DSP_DSTMOD_SHIFT,
381 D3DSPDM_FORCE_DWORD = 0X7FFFFFFF
382 } D3DSHADER_PARAM_DSTMOD_TYPE;
384 /** destination param */
385 #define D3DSP_DSTSHIFT_SHIFT 24
386 #define D3DSP_DSTSHIFT_MASK (0xF << D3DSP_DSTSHIFT_SHIFT)
388 /** destination/source reg type */
389 #define D3DSP_REGTYPE_SHIFT 28
390 #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT)
392 typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
393 D3DSPR_TEMP = 0 << D3DSP_REGTYPE_SHIFT,
394 D3DSPR_INPUT = 1 << D3DSP_REGTYPE_SHIFT,
395 D3DSPR_CONST = 2 << D3DSP_REGTYPE_SHIFT,
396 D3DSPR_ADDR = 3 << D3DSP_REGTYPE_SHIFT,
397 D3DSPR_TEXTURE = 3 << D3DSP_REGTYPE_SHIFT,
398 D3DSPR_RASTOUT = 4 << D3DSP_REGTYPE_SHIFT,
399 D3DSPR_ATTROUT = 5 << D3DSP_REGTYPE_SHIFT,
400 D3DSPR_TEXCRDOUT = 6 << D3DSP_REGTYPE_SHIFT,
401 D3DSPR_FORCE_DWORD = 0x7FFFFFFF
402 } D3DSHADER_PARAM_REGISTER_TYPE;
404 typedef enum _D3DVS_RASTOUT_OFFSETS {
405 D3DSRO_POSITION = 0,
406 D3DSRO_FOG = 1,
407 D3DSRO_POINT_SIZE = 2,
408 D3DSRO_FORCE_DWORD = 0x7FFFFFFF
409 } D3DVS_RASTOUT_OFFSETS;
411 #define D3DVS_ADDRESSMODE_SHIFT 13
412 #define D3DVS_ADDRESSMODE_MASK (0x1 << D3DVS_ADDRESSMODE_SHIFT)
414 typedef enum _D3DVS_ADDRESSMODE_TYPE {
415 D3DVS_ADDRMODE_ABSOLUTE = 0 << D3DVS_ADDRESSMODE_SHIFT,
416 D3DVS_ADDRMODE_RELATIVE = 1 << D3DVS_ADDRESSMODE_SHIFT,
417 D3DVS_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
418 } D3DVS_ADDRESSMODE_TYPE;
420 #define D3DVS_SWIZZLE_SHIFT 16
421 #define D3DVS_SWIZZLE_MASK (0xFF << D3DVS_SWIZZLE_SHIFT)
423 #define D3DSP_SWIZZLE_SHIFT 16
424 #define D3DSP_SWIZZLE_MASK (0xFF << D3DSP_SWIZZLE_SHIFT)
426 #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
427 #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
428 #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
429 #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
431 #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
432 #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
433 #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
434 #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
436 #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
437 #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
438 #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
439 #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
441 #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
442 #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
443 #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
444 #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
446 #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
448 #define D3DSP_NOSWIZZLE \
449 ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
451 #define D3DSP_SRCMOD_SHIFT 24
452 #define D3DSP_SRCMOD_MASK (0xF << D3DSP_SRCMOD_SHIFT)
454 typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
455 D3DSPSM_NONE = 0 << D3DSP_SRCMOD_SHIFT,
456 D3DSPSM_NEG = 1 << D3DSP_SRCMOD_SHIFT,
457 D3DSPSM_BIAS = 2 << D3DSP_SRCMOD_SHIFT,
458 D3DSPSM_BIASNEG = 3 << D3DSP_SRCMOD_SHIFT,
459 D3DSPSM_SIGN = 4 << D3DSP_SRCMOD_SHIFT,
460 D3DSPSM_SIGNNEG = 5 << D3DSP_SRCMOD_SHIFT,
461 D3DSPSM_COMP = 6 << D3DSP_SRCMOD_SHIFT,
462 D3DSPSM_X2 = 7 << D3DSP_SRCMOD_SHIFT,
463 D3DSPSM_X2NEG = 8 << D3DSP_SRCMOD_SHIFT,
464 D3DSPSM_DZ = 9 << D3DSP_SRCMOD_SHIFT,
465 D3DSPSM_DW = 10 << D3DSP_SRCMOD_SHIFT,
466 D3DSPSM_FORCE_DWORD = 0x7FFFFFFF
467 } D3DSHADER_PARAM_SRCMOD_TYPE;
469 #define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
470 #define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
471 #define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
472 #define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
474 #define D3DSI_COMMENTSIZE_SHIFT 16
475 #define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
477 #define D3DSHADER_COMMENT(commentSize) \
478 ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
480 #define D3DPS_END() 0x0000FFFF
481 #define D3DVS_END() 0x0000FFFF
484 /*****************************************************************************
485 * Direct 3D v8 enumerated types
487 typedef enum _D3DBACKBUFFER_TYPE {
488 D3DBACKBUFFER_TYPE_MONO = 0,
489 D3DBACKBUFFER_TYPE_LEFT = 1,
490 D3DBACKBUFFER_TYPE_RIGHT = 2,
492 D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
493 } D3DBACKBUFFER_TYPE;
495 typedef enum _D3DBASISTYPE{
496 D3DBASIS_BEZIER = 0,
497 D3DBASIS_BSPLINE = 1,
498 D3DBASIS_INTERPOLATE = 2,
500 D3DBASIS_FORCE_DWORD = 0x7fffffff
501 } D3DBASISTYPE;
503 typedef enum _D3DBLEND {
504 D3DBLEND_ZERO = 1,
505 D3DBLEND_ONE = 2,
506 D3DBLEND_SRCCOLOR = 3,
507 D3DBLEND_INVSRCCOLOR = 4,
508 D3DBLEND_SRCALPHA = 5,
509 D3DBLEND_INVSRCALPHA = 6,
510 D3DBLEND_DESTALPHA = 7,
511 D3DBLEND_INVDESTALPHA = 8,
512 D3DBLEND_DESTCOLOR = 9,
513 D3DBLEND_INVDESTCOLOR = 10,
514 D3DBLEND_SRCALPHASAT = 11,
515 D3DBLEND_BOTHSRCALPHA = 12,
516 D3DBLEND_BOTHINVSRCALPHA = 13,
518 D3DBLEND_FORCE_DWORD = 0x7fffffff
519 } D3DBLEND;
521 typedef enum _D3DBLENDOP {
522 D3DBLENDOP_ADD = 1,
523 D3DBLENDOP_SUBTRACT = 2,
524 D3DBLENDOP_REVSUBTRACT = 3,
525 D3DBLENDOP_MIN = 4,
526 D3DBLENDOP_MAX = 5,
528 D3DBLENDOP_FORCE_DWORD = 0x7fffffff
529 } D3DBLENDOP;
531 typedef enum _D3DCMPFUNC {
532 D3DCMP_NEVER = 1,
533 D3DCMP_LESS = 2,
534 D3DCMP_EQUAL = 3,
535 D3DCMP_LESSEQUAL = 4,
536 D3DCMP_GREATER = 5,
537 D3DCMP_NOTEQUAL = 6,
538 D3DCMP_GREATEREQUAL = 7,
539 D3DCMP_ALWAYS = 8,
541 D3DCMP_FORCE_DWORD = 0x7fffffff
542 } D3DCMPFUNC;
544 typedef enum _D3DCUBEMAP_FACES {
545 D3DCUBEMAP_FACE_POSITIVE_X = 0,
546 D3DCUBEMAP_FACE_NEGATIVE_X = 1,
547 D3DCUBEMAP_FACE_POSITIVE_Y = 2,
548 D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
549 D3DCUBEMAP_FACE_POSITIVE_Z = 4,
550 D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
552 D3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff
553 } D3DCUBEMAP_FACES;
555 typedef enum _D3DCULL {
556 D3DCULL_NONE = 1,
557 D3DCULL_CW = 2,
558 D3DCULL_CCW = 3,
560 D3DCULL_FORCE_DWORD = 0x7fffffff
561 } D3DCULL;
563 typedef enum _D3DDEBUGMONITORTOKENS {
564 D3DDMT_ENABLE = 0,
565 D3DDMT_DISABLE = 1,
567 D3DDMT_FORCE_DWORD = 0x7fffffff
568 } D3DDEBUGMONITORTOKENS;
570 typedef enum _D3DDEVTYPE {
571 D3DDEVTYPE_HAL = 1,
572 D3DDEVTYPE_REF = 2,
573 D3DDEVTYPE_SW = 3,
575 D3DDEVTYPE_FORCE_DWORD = 0xffffffff
576 } D3DDEVTYPE;
578 typedef enum _D3DFILLMODE {
579 D3DFILL_POINT = 1,
580 D3DFILL_WIREFRAME = 2,
581 D3DFILL_SOLID = 3,
583 D3DFILL_FORCE_DWORD = 0x7fffffff
584 } D3DFILLMODE;
586 typedef enum _D3DFOGMODE {
587 D3DFOG_NONE = 0,
588 D3DFOG_EXP = 1,
589 D3DFOG_EXP2 = 2,
590 D3DFOG_LINEAR = 3,
592 D3DFOG_FORCE_DWORD = 0x7fffffff
593 } D3DFOGMODE;
595 typedef enum _D3DFORMAT {
596 D3DFMT_UNKNOWN = 0,
598 D3DFMT_R8G8B8 = 20,
599 D3DFMT_A8R8G8B8 = 21,
600 D3DFMT_X8R8G8B8 = 22,
601 D3DFMT_R5G6B5 = 23,
602 D3DFMT_X1R5G5B5 = 24,
603 D3DFMT_A1R5G5B5 = 25,
604 D3DFMT_A4R4G4B4 = 26,
605 D3DFMT_R3G3B2 = 27,
606 D3DFMT_A8 = 28,
607 D3DFMT_A8R3G3B2 = 29,
608 D3DFMT_X4R4G4B4 = 30,
610 D3DFMT_A8P8 = 40,
611 D3DFMT_P8 = 41,
613 D3DFMT_L8 = 50,
614 D3DFMT_A8L8 = 51,
615 D3DFMT_A4L4 = 52,
617 D3DFMT_V8U8 = 60,
618 D3DFMT_L6V5U5 = 61,
619 D3DFMT_X8L8V8U8 = 62,
620 D3DFMT_Q8W8V8U8 = 63,
621 D3DFMT_V16U16 = 64,
622 D3DFMT_W11V11U10 = 65,
624 D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
625 D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
626 D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
627 D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
628 D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
629 D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
630 D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
632 D3DFMT_D16_LOCKABLE = 70,
633 D3DFMT_D32 = 71,
634 D3DFMT_D15S1 = 73,
635 D3DFMT_D24S8 = 75,
636 D3DFMT_D16 = 80,
637 D3DFMT_D24X8 = 77,
638 D3DFMT_D24X4S4 = 79,
640 D3DFMT_VERTEXDATA = 100,
641 D3DFMT_INDEX16 = 101,
642 D3DFMT_INDEX32 = 102,
644 D3DFMT_FORCE_DWORD = 0xFFFFFFFF
645 } D3DFORMAT;
647 typedef enum _D3DLIGHTTYPE {
648 D3DLIGHT_POINT = 1,
649 D3DLIGHT_SPOT = 2,
650 D3DLIGHT_DIRECTIONAL = 3,
652 D3DLIGHT_FORCE_DWORD = 0x7fffffff
653 } D3DLIGHTTYPE;
655 typedef enum _D3DMATERIALCOLORSOURCE {
656 D3DMCS_MATERIAL = 0,
657 D3DMCS_COLOR1 = 1,
658 D3DMCS_COLOR2 = 2,
660 D3DMCS_FORCE_DWORD = 0x7fffffff
661 } D3DMATERIALCOLORSOURCE;
663 typedef enum _D3DMULTISAMPLE_TYPE {
664 D3DMULTISAMPLE_NONE = 0,
665 D3DMULTISAMPLE_2_SAMPLES = 2,
666 D3DMULTISAMPLE_3_SAMPLES = 3,
667 D3DMULTISAMPLE_4_SAMPLES = 4,
668 D3DMULTISAMPLE_5_SAMPLES = 5,
669 D3DMULTISAMPLE_6_SAMPLES = 6,
670 D3DMULTISAMPLE_7_SAMPLES = 7,
671 D3DMULTISAMPLE_8_SAMPLES = 8,
672 D3DMULTISAMPLE_9_SAMPLES = 9,
673 D3DMULTISAMPLE_10_SAMPLES = 10,
674 D3DMULTISAMPLE_11_SAMPLES = 11,
675 D3DMULTISAMPLE_12_SAMPLES = 12,
676 D3DMULTISAMPLE_13_SAMPLES = 13,
677 D3DMULTISAMPLE_14_SAMPLES = 14,
678 D3DMULTISAMPLE_15_SAMPLES = 15,
679 D3DMULTISAMPLE_16_SAMPLES = 16,
681 D3DMULTISAMPLE_FORCE_DWORD = 0xffffffff
682 } D3DMULTISAMPLE_TYPE;
684 typedef enum _D3DORDERTYPE {
685 D3DORDER_LINEAR = 1,
686 D3DORDER_QUADRATIC = 2,
687 D3DORDER_CUBIC = 3,
688 D3DORDER_QUINTIC = 5,
690 D3DORDER_FORCE_DWORD = 0x7fffffff
691 } D3DORDERTYPE;
693 typedef enum _D3DPATCHEDGESTYLE {
694 D3DPATCHEDGE_DISCRETE = 0,
695 D3DPATCHEDGE_CONTINUOUS = 1,
697 D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
698 } D3DPATCHEDGESTYLE;
700 typedef enum _D3DPOOL {
701 D3DPOOL_DEFAULT = 0,
702 D3DPOOL_MANAGED = 1,
703 D3DPOOL_SYSTEMMEM = 2,
704 D3DPOOL_SCRATCH = 3,
706 D3DPOOL_FORCE_DWORD = 0x7fffffff
707 } D3DPOOL;
709 typedef enum _D3DPRIMITIVETYPE {
710 D3DPT_POINTLIST = 1,
711 D3DPT_LINELIST = 2,
712 D3DPT_LINESTRIP = 3,
713 D3DPT_TRIANGLELIST = 4,
714 D3DPT_TRIANGLESTRIP = 5,
715 D3DPT_TRIANGLEFAN = 6,
717 D3DPT_FORCE_DWORD = 0x7fffffff
718 } D3DPRIMITIVETYPE;
720 typedef enum _D3DRENDERSTATETYPE {
721 D3DRS_ZENABLE = 7,
722 D3DRS_FILLMODE = 8,
723 D3DRS_SHADEMODE = 9,
724 D3DRS_LINEPATTERN = 10,
725 D3DRS_ZWRITEENABLE = 14,
726 D3DRS_ALPHATESTENABLE = 15,
727 D3DRS_LASTPIXEL = 16,
728 D3DRS_SRCBLEND = 19,
729 D3DRS_DESTBLEND = 20,
730 D3DRS_CULLMODE = 22,
731 D3DRS_ZFUNC = 23,
732 D3DRS_ALPHAREF = 24,
733 D3DRS_ALPHAFUNC = 25,
734 D3DRS_DITHERENABLE = 26,
735 D3DRS_ALPHABLENDENABLE = 27,
736 D3DRS_FOGENABLE = 28,
737 D3DRS_SPECULARENABLE = 29,
738 D3DRS_ZVISIBLE = 30,
739 D3DRS_FOGCOLOR = 34,
740 D3DRS_FOGTABLEMODE = 35,
741 D3DRS_FOGSTART = 36,
742 D3DRS_FOGEND = 37,
743 D3DRS_FOGDENSITY = 38,
744 D3DRS_EDGEANTIALIAS = 40,
745 D3DRS_ZBIAS = 47,
746 D3DRS_RANGEFOGENABLE = 48,
747 D3DRS_STENCILENABLE = 52,
748 D3DRS_STENCILFAIL = 53,
749 D3DRS_STENCILZFAIL = 54,
750 D3DRS_STENCILPASS = 55,
751 D3DRS_STENCILFUNC = 56,
752 D3DRS_STENCILREF = 57,
753 D3DRS_STENCILMASK = 58,
754 D3DRS_STENCILWRITEMASK = 59,
755 D3DRS_TEXTUREFACTOR = 60,
756 D3DRS_WRAP0 = 128,
757 D3DRS_WRAP1 = 129,
758 D3DRS_WRAP2 = 130,
759 D3DRS_WRAP3 = 131,
760 D3DRS_WRAP4 = 132,
761 D3DRS_WRAP5 = 133,
762 D3DRS_WRAP6 = 134,
763 D3DRS_WRAP7 = 135,
764 D3DRS_CLIPPING = 136,
765 D3DRS_LIGHTING = 137,
766 D3DRS_AMBIENT = 139,
767 D3DRS_FOGVERTEXMODE = 140,
768 D3DRS_COLORVERTEX = 141,
769 D3DRS_LOCALVIEWER = 142,
770 D3DRS_NORMALIZENORMALS = 143,
771 D3DRS_DIFFUSEMATERIALSOURCE = 145,
772 D3DRS_SPECULARMATERIALSOURCE = 146,
773 D3DRS_AMBIENTMATERIALSOURCE = 147,
774 D3DRS_EMISSIVEMATERIALSOURCE = 148,
775 D3DRS_VERTEXBLEND = 151,
776 D3DRS_CLIPPLANEENABLE = 152,
777 D3DRS_SOFTWAREVERTEXPROCESSING = 153,
778 D3DRS_POINTSIZE = 154,
779 D3DRS_POINTSIZE_MIN = 155,
780 D3DRS_POINTSPRITEENABLE = 156,
781 D3DRS_POINTSCALEENABLE = 157,
782 D3DRS_POINTSCALE_A = 158,
783 D3DRS_POINTSCALE_B = 159,
784 D3DRS_POINTSCALE_C = 160,
785 D3DRS_MULTISAMPLEANTIALIAS = 161,
786 D3DRS_MULTISAMPLEMASK = 162,
787 D3DRS_PATCHEDGESTYLE = 163,
788 D3DRS_PATCHSEGMENTS = 164,
789 D3DRS_DEBUGMONITORTOKEN = 165,
790 D3DRS_POINTSIZE_MAX = 166,
791 D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
792 D3DRS_COLORWRITEENABLE = 168,
793 D3DRS_TWEENFACTOR = 170,
794 D3DRS_BLENDOP = 171,
795 D3DRS_POSITIONORDER = 172,
796 D3DRS_NORMALORDER = 173,
798 D3DRS_FORCE_DWORD = 0x7fffffff
799 } D3DRENDERSTATETYPE;
801 typedef enum _D3DRESOURCETYPE {
802 D3DRTYPE_SURFACE = 1,
803 D3DRTYPE_VOLUME = 2,
804 D3DRTYPE_TEXTURE = 3,
805 D3DRTYPE_VOLUMETEXTURE = 4,
806 D3DRTYPE_CUBETEXTURE = 5,
807 D3DRTYPE_VERTEXBUFFER = 6,
808 D3DRTYPE_INDEXBUFFER = 7,
810 D3DRTYPE_FORCE_DWORD = 0x7fffffff
811 } D3DRESOURCETYPE;
813 typedef enum _D3DSHADEMODE {
814 D3DSHADE_FLAT = 1,
815 D3DSHADE_GOURAUD = 2,
816 D3DSHADE_PHONG = 3,
818 D3DSHADE_FORCE_DWORD = 0x7fffffff
819 } D3DSHADEMODE;
821 typedef enum _D3DSTATEBLOCKTYPE {
822 D3DSBT_ALL = 1,
823 D3DSBT_PIXELSTATE = 2,
824 D3DSBT_VERTEXSTATE = 3,
826 D3DSBT_FORCE_DWORD = 0xffffffff
827 } D3DSTATEBLOCKTYPE;
829 typedef enum _D3DSTENCILOP {
830 D3DSTENCILOP_KEEP = 1,
831 D3DSTENCILOP_ZERO = 2,
832 D3DSTENCILOP_REPLACE = 3,
833 D3DSTENCILOP_INCRSAT = 4,
834 D3DSTENCILOP_DECRSAT = 5,
835 D3DSTENCILOP_INVERT = 6,
836 D3DSTENCILOP_INCR = 7,
837 D3DSTENCILOP_DECR = 8,
839 D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
840 } D3DSTENCILOP;
842 typedef enum _D3DSWAPEFFECT {
843 D3DSWAPEFFECT_DISCARD = 1,
844 D3DSWAPEFFECT_FLIP = 2,
845 D3DSWAPEFFECT_COPY = 3,
846 D3DSWAPEFFECT_COPY_VSYNC = 4,
848 D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
849 } D3DSWAPEFFECT;
851 typedef enum _D3DTEXTUREADDRESS {
852 D3DTADDRESS_WRAP = 1,
853 D3DTADDRESS_MIRROR = 2,
854 D3DTADDRESS_CLAMP = 3,
855 D3DTADDRESS_BORDER = 4,
856 D3DTADDRESS_MIRRORONCE = 5,
858 D3DTADDRESS_FORCE_DWORD = 0x7fffffff
859 } D3DTEXTUREADDRESS;
861 typedef enum _D3DTEXTUREFILTERTYPE {
862 D3DTEXF_NONE = 0,
863 D3DTEXF_POINT = 1,
864 D3DTEXF_LINEAR = 2,
865 D3DTEXF_ANISOTROPIC = 3,
866 D3DTEXF_FLATCUBIC = 4,
867 D3DTEXF_GAUSSIANCUBIC = 5,
869 D3DTEXF_FORCE_DWORD = 0x7fffffff
870 } D3DTEXTUREFILTERTYPE;
872 typedef enum _D3DTEXTUREOP {
873 D3DTOP_DISABLE = 1,
874 D3DTOP_SELECTARG1 = 2,
875 D3DTOP_SELECTARG2 = 3,
876 D3DTOP_MODULATE = 4,
877 D3DTOP_MODULATE2X = 5,
878 D3DTOP_MODULATE4X = 6,
879 D3DTOP_ADD = 7,
880 D3DTOP_ADDSIGNED = 8,
881 D3DTOP_ADDSIGNED2X = 9,
882 D3DTOP_SUBTRACT = 10,
883 D3DTOP_ADDSMOOTH = 11,
884 D3DTOP_BLENDDIFFUSEALPHA = 12,
885 D3DTOP_BLENDTEXTUREALPHA = 13,
886 D3DTOP_BLENDFACTORALPHA = 14,
887 D3DTOP_BLENDTEXTUREALPHAPM = 15,
888 D3DTOP_BLENDCURRENTALPHA = 16,
889 D3DTOP_PREMODULATE = 17,
890 D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
891 D3DTOP_MODULATECOLOR_ADDALPHA = 19,
892 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
893 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
894 D3DTOP_BUMPENVMAP = 22,
895 D3DTOP_BUMPENVMAPLUMINANCE = 23,
896 D3DTOP_DOTPRODUCT3 = 24,
897 D3DTOP_MULTIPLYADD = 25,
898 D3DTOP_LERP = 26,
900 D3DTOP_FORCE_DWORD = 0x7fffffff,
901 } D3DTEXTUREOP;
903 typedef enum _D3DTEXTURESTAGESTATETYPE {
904 D3DTSS_COLOROP = 1,
905 D3DTSS_COLORARG1 = 2,
906 D3DTSS_COLORARG2 = 3,
907 D3DTSS_ALPHAOP = 4,
908 D3DTSS_ALPHAARG1 = 5,
909 D3DTSS_ALPHAARG2 = 6,
910 D3DTSS_BUMPENVMAT00 = 7,
911 D3DTSS_BUMPENVMAT01 = 8,
912 D3DTSS_BUMPENVMAT10 = 9,
913 D3DTSS_BUMPENVMAT11 = 10,
914 D3DTSS_TEXCOORDINDEX = 11,
915 D3DTSS_ADDRESSU = 13,
916 D3DTSS_ADDRESSV = 14,
917 D3DTSS_BORDERCOLOR = 15,
918 D3DTSS_MAGFILTER = 16,
919 D3DTSS_MINFILTER = 17,
920 D3DTSS_MIPFILTER = 18,
921 D3DTSS_MIPMAPLODBIAS = 19,
922 D3DTSS_MAXMIPLEVEL = 20,
923 D3DTSS_MAXANISOTROPY = 21,
924 D3DTSS_BUMPENVLSCALE = 22,
925 D3DTSS_BUMPENVLOFFSET = 23,
926 D3DTSS_TEXTURETRANSFORMFLAGS = 24,
927 D3DTSS_ADDRESSW = 25,
928 D3DTSS_COLORARG0 = 26,
929 D3DTSS_ALPHAARG0 = 27,
930 D3DTSS_RESULTARG = 28,
932 D3DTSS_FORCE_DWORD = 0x7fffffff
933 } D3DTEXTURESTAGESTATETYPE;
935 typedef enum _D3DTEXTURETRANSFORMFLAGS {
936 D3DTTFF_DISABLE = 0,
937 D3DTTFF_COUNT1 = 1,
938 D3DTTFF_COUNT2 = 2,
939 D3DTTFF_COUNT3 = 3,
940 D3DTTFF_COUNT4 = 4,
941 D3DTTFF_PROJECTED = 256,
943 D3DTTFF_FORCE_DWORD = 0x7fffffff
944 } D3DTEXTURETRANSFORMFLAGS;
946 typedef enum _D3DTRANSFORMSTATETYPE {
947 D3DTS_VIEW = 2,
948 D3DTS_PROJECTION = 3,
949 D3DTS_TEXTURE0 = 16,
950 D3DTS_TEXTURE1 = 17,
951 D3DTS_TEXTURE2 = 18,
952 D3DTS_TEXTURE3 = 19,
953 D3DTS_TEXTURE4 = 20,
954 D3DTS_TEXTURE5 = 21,
955 D3DTS_TEXTURE6 = 22,
956 D3DTS_TEXTURE7 = 23,
958 D3DTS_FORCE_DWORD = 0x7fffffff
959 } D3DTRANSFORMSTATETYPE;
961 typedef enum _D3DVERTEXBLENDFLAGS {
962 D3DVBF_DISABLE = 0,
963 D3DVBF_1WEIGHTS = 1,
964 D3DVBF_2WEIGHTS = 2,
965 D3DVBF_3WEIGHTS = 3,
966 D3DVBF_TWEENING = 255,
967 D3DVBF_0WEIGHTS = 256
968 } D3DVERTEXBLENDFLAGS;
970 typedef enum _D3DZBUFFERTYPE {
971 D3DZB_FALSE = 0,
972 D3DZB_TRUE = 1,
973 D3DZB_USEW = 2,
975 D3DZB_FORCE_DWORD = 0x7fffffff
976 } D3DZBUFFERTYPE;
979 /*****************************************************************************
980 * Direct 3D v8 typedefs
982 typedef DWORD D3DCOLOR;
984 /*****************************************************************************
985 * Direct 3D v8 structures
987 typedef struct _D3DADAPTER_IDENTIFIER8 {
988 char Driver[MAX_DEVICE_IDENTIFIER_STRING];
989 char Description[MAX_DEVICE_IDENTIFIER_STRING];
991 LARGE_INTEGER DriverVersion;
992 DWORD VendorId;
993 DWORD DeviceId;
994 DWORD SubSysId;
995 DWORD Revision;
997 GUID DeviceIdentifier;
999 DWORD WHQLLevel;
1000 } D3DADAPTER_IDENTIFIER8;
1002 typedef struct _D3DBOX {
1003 UINT Left;
1004 UINT Top;
1005 UINT Right;
1006 UINT Bottom;
1007 UINT Front;
1008 UINT Back;
1009 } D3DBOX;
1011 typedef struct _D3DCLIPSTATUS8 {
1012 DWORD ClipUnion;
1013 DWORD ClipIntersection;
1014 } D3DCLIPSTATUS8;
1016 typedef struct _D3DCOLORVALUE {
1017 float r;
1018 float g;
1019 float b;
1020 float a;
1021 } D3DCOLORVALUE;
1023 typedef struct _D3DDEVICE_CREATION_PARAMETERS {
1024 UINT AdapterOrdinal;
1025 D3DDEVTYPE DeviceType;
1026 HWND hFocusWindow;
1027 DWORD BehaviorFlags;
1028 } D3DDEVICE_CREATION_PARAMETERS;
1030 typedef struct _D3DDISPLAYMODE {
1031 UINT Width;
1032 UINT Height;
1033 UINT RefreshRate;
1034 D3DFORMAT Format;
1035 } D3DDISPLAYMODE;
1037 typedef struct _D3DGAMMARAMP {
1038 WORD red [256];
1039 WORD green[256];
1040 WORD blue [256];
1041 } D3DGAMMARAMP;
1043 typedef struct _D3DINDEXBUFFER_DESC {
1044 D3DFORMAT Format;
1045 D3DRESOURCETYPE Type;
1046 DWORD Usage;
1047 D3DPOOL Pool;
1048 UINT Size;
1049 } D3DINDEXBUFFER_DESC;
1051 typedef struct _D3DVECTOR {
1052 float x;
1053 float y;
1054 float z;
1055 } D3DVECTOR;
1057 typedef struct _D3DLIGHT8 {
1058 D3DLIGHTTYPE Type;
1059 D3DCOLORVALUE Diffuse;
1060 D3DCOLORVALUE Specular;
1061 D3DCOLORVALUE Ambient;
1062 D3DVECTOR Position;
1063 D3DVECTOR Direction;
1064 float Range;
1065 float Falloff;
1066 float Attenuation0;
1067 float Attenuation1;
1068 float Attenuation2;
1069 float Theta;
1070 float Phi;
1071 } D3DLIGHT8;
1073 typedef struct _D3DLINEPATTERN {
1074 WORD wRepeatFactor;
1075 WORD wLinePattern;
1076 } D3DLINEPATTERN;
1078 typedef struct _D3DLOCKED_BOX {
1079 INT RowPitch;
1080 INT SlicePitch;
1081 void* pBits;
1082 } D3DLOCKED_BOX;
1084 typedef struct _D3DLOCKED_RECT {
1085 INT Pitch;
1086 void* pBits;
1087 } D3DLOCKED_RECT;
1089 typedef struct _D3DMATERIAL8 {
1090 D3DCOLORVALUE Diffuse;
1091 D3DCOLORVALUE Ambient;
1092 D3DCOLORVALUE Specular;
1093 D3DCOLORVALUE Emissive;
1094 float Power;
1095 } D3DMATERIAL8;
1097 typedef struct _D3DMATRIX {
1098 union {
1099 struct {
1100 float _11, _12, _13, _14;
1101 float _21, _22, _23, _24;
1102 float _31, _32, _33, _34;
1103 float _41, _42, _43, _44;
1104 } DUMMYSTRUCTNAME;
1105 float m[4][4];
1106 } DUMMYUNIONNAME;
1107 } D3DMATRIX;
1109 typedef struct _D3DPRESENT_PARAMETERS_ {
1110 UINT BackBufferWidth;
1111 UINT BackBufferHeight;
1112 D3DFORMAT BackBufferFormat;
1113 UINT BackBufferCount;
1115 D3DMULTISAMPLE_TYPE MultiSampleType;
1117 D3DSWAPEFFECT SwapEffect;
1118 HWND hDeviceWindow;
1119 BOOL Windowed;
1120 BOOL EnableAutoDepthStencil;
1121 D3DFORMAT AutoDepthStencilFormat;
1122 DWORD Flags;
1124 UINT FullScreen_RefreshRateInHz;
1125 UINT FullScreen_PresentationInterval;
1127 } D3DPRESENT_PARAMETERS;
1129 typedef struct _D3DRANGE {
1130 UINT Offset;
1131 UINT Size;
1132 } D3DRANGE;
1134 typedef struct _D3DRASTER_STATUS {
1135 BOOL InVBlank;
1136 UINT ScanLine;
1137 } D3DRASTER_STATUS;
1139 typedef struct _D3DRECT {
1140 LONG x1;
1141 LONG y1;
1142 LONG x2;
1143 LONG y2;
1144 } D3DRECT;
1146 typedef struct _D3DRECTPATCH_INFO {
1147 UINT StartVertexOffsetWidth;
1148 UINT StartVertexOffsetHeight;
1149 UINT Width;
1150 UINT Height;
1151 UINT Stride;
1152 D3DBASISTYPE Basis;
1153 D3DORDERTYPE Order;
1154 } D3DRECTPATCH_INFO;
1156 typedef struct _D3DSURFACE_DESC {
1157 D3DFORMAT Format;
1158 D3DRESOURCETYPE Type;
1159 DWORD Usage;
1160 D3DPOOL Pool;
1161 UINT Size;
1162 D3DMULTISAMPLE_TYPE MultiSampleType;
1163 UINT Width;
1164 UINT Height;
1165 } D3DSURFACE_DESC;
1167 typedef struct _D3DTRIPATCH_INFO {
1168 UINT StartVertexOffset;
1169 UINT NumVertices;
1170 D3DBASISTYPE Basis;
1171 D3DORDERTYPE Order;
1172 } D3DTRIPATCH_INFO;
1174 typedef struct _D3DVERTEXBUFFER_DESC {
1175 D3DFORMAT Format;
1176 D3DRESOURCETYPE Type;
1177 DWORD Usage;
1178 D3DPOOL Pool;
1179 UINT Size;
1180 DWORD FVF;
1181 } D3DVERTEXBUFFER_DESC;
1183 typedef struct _D3DVIEWPORT8 {
1184 DWORD X;
1185 DWORD Y;
1186 DWORD Width;
1187 DWORD Height;
1188 float MinZ;
1189 float MaxZ;
1190 } D3DVIEWPORT8;
1192 typedef struct _D3DVOLUME_DESC {
1193 D3DFORMAT Format;
1194 D3DRESOURCETYPE Type;
1195 DWORD Usage;
1196 D3DPOOL Pool;
1197 UINT Size;
1198 UINT Width;
1199 UINT Height;
1200 UINT Depth;
1201 } D3DVOLUME_DESC;
1203 #endif /* __WINE_D3D8TYPES_H */