source: Include/directx9/d3d9types.sbp@ 34

Last change on this file since 34 was 1, checked in by (none), 18 years ago
File size: 44.7 KB
Line 
1' d3d9types.sbp
2
3
4#ifndef _INC_D3D9TYPES
5#define _INC_D3D9TYPES
6
7
8Const D3DCOLOR_ARGB(a,r,g,b) = ((a and &HFF)<<24) or ((r and &HFF)<<16) or ((g and &HFF)<<8) or (b and &HFF)
9Const D3DCOLOR_RGBA(r,g,b,a) = D3DCOLOR_ARGB(a,r,g,b)
10Const D3DCOLOR_XRGB(r,g,b) = D3DCOLOR_ARGB(&HFF,r,g,b)
11
12Const D3DCOLOR_COLORVALUE(r,g,b,a) = D3DCOLOR_RGBA(r*255,g*255,b*255,a*255)
13
14
15Type D3DVECTOR
16 x As Single
17 y As Single
18 z As Single
19End Type
20
21Type D3DCOLORVALUE
22 r As Single
23 g As Single
24 b As Single
25 a As Single
26End Type
27
28Type D3DRECT
29 x1 As Long
30 y1 As Long
31 x2 As Long
32 y2 As Long
33End Type
34
35Type D3DMATRIX
36 m[3,3] As Single
37End Type
38
39Type D3DVIEWPORT9
40 X As DWord
41 Y As DWord
42 Width As DWord
43 Height As DWord
44 MinZ As Single
45 MaxZ As Single
46End Type
47
48' Max number of user clipping planes, supported in D3D.
49Const D3DMAXUSERCLIPPLANES = 32
50
51' These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE
52Const D3DCLIPPLANE0 = 1 << 0
53Const D3DCLIPPLANE1 = 1 << 1
54Const D3DCLIPPLANE2 = 1 << 2
55Const D3DCLIPPLANE3 = 1 << 3
56Const D3DCLIPPLANE4 = 1 << 4
57Const D3DCLIPPLANE5 = 1 << 5
58
59Const D3DCS_LEFT = &H00000001
60Const D3DCS_RIGHT = &H00000002
61Const D3DCS_TOP = &H00000004
62Const D3DCS_BOTTOM = &H00000008
63Const D3DCS_FRONT = &H00000010
64Const D3DCS_BACK = &H00000020
65Const D3DCS_PLANE0 = &H00000040
66Const D3DCS_PLANE1 = &H00000080
67Const D3DCS_PLANE2 = &H00000100
68Const D3DCS_PLANE3 = &H00000200
69Const D3DCS_PLANE4 = &H00000400
70Const D3DCS_PLANE5 = &H00000800
71Const D3DCS_ALL = D3DCS_LEFT or D3DCS_RIGHT or D3DCS_TOP or D3DCS_BOTTOM or D3DCS_FRONT or D3DCS_BACK or D3DCS_PLANE0 or D3DCS_PLANE1 or D3DCS_PLANE2 or D3DCS_PLANE3 or D3DCS_PLANE4 or D3DCS_PLANE5
72Type D3DCLIPSTATUS9
73 ClipUnion As DWord
74 ClipIntersection As DWord
75End Type
76
77Type D3DMATERIAL9
78 Diffuse As D3DCOLORVALUE
79 Ambient As D3DCOLORVALUE
80 Specular As D3DCOLORVALUE
81 Emissive As D3DCOLORVALUE
82 Power As Single
83End Type
84
85Const Enum D3DLIGHTTYPE
86 D3DLIGHT_POINT = 1
87 D3DLIGHT_SPOT = 2
88 D3DLIGHT_DIRECTIONAL = 3
89 D3DLIGHT_FORCE_DWORD = &H7FFFFFFF
90End Enum
91
92Type D3DLIGHT9
93 Type_ As D3DLIGHTTYPE
94 Diffuse As D3DCOLORVALUE
95 Specular As D3DCOLORVALUE
96 Ambient As D3DCOLORVALUE
97 Position As D3DVECTOR
98 Direction As D3DVECTOR
99 Range As Single
100 Falloff As Single
101 Attenuation0 As Single
102 Attenuation1 As Single
103 Attenuation2 As Single
104 Theta As Single
105 Phi As Single
106End Type
107
108
109' Options for clearing
110Const D3DCLEAR_TARGET = &H00000001 'Clear target surface
111Const D3DCLEAR_ZBUFFER = &H00000002 'Clear target z buffer
112Const D3DCLEAR_STENCIL = &H00000004 'Clear stencil planes
113
114
115' The following defines the rendering states
116Const Enum D3DSHADEMODE
117 D3DSHADE_FLAT = 1
118 D3DSHADE_GOURAUD = 2
119 D3DSHADE_PHONG = 3
120 D3DSHADE_FORCE_DWORD = &H7FFFFFFF
121End Enum
122
123Const Enum D3DFILLMODE
124 D3DFILL_POINT = 1
125 D3DFILL_WIREFRAME = 2
126 D3DFILL_SOLID = 3
127 D3DFILL_FORCE_DWORD = &H7FFFFFFF
128End Enum
129
130Const Enum D3DBLEND
131 D3DBLEND_ZERO = 1
132 D3DBLEND_ONE = 2
133 D3DBLEND_SRCCOLOR = 3
134 D3DBLEND_INVSRCCOLOR = 4
135 D3DBLEND_SRCALPHA = 5
136 D3DBLEND_INVSRCALPHA = 6
137 D3DBLEND_DESTALPHA = 7
138 D3DBLEND_INVDESTALPHA = 8
139 D3DBLEND_DESTCOLOR = 9
140 D3DBLEND_INVDESTCOLOR = 10
141 D3DBLEND_SRCALPHASAT = 11
142 D3DBLEND_BOTHSRCALPHA = 12
143 D3DBLEND_BOTHINVSRCALPHA = 13
144 D3DBLEND_BLENDFACTOR = 14 'Only supported if D3DPBLENDCAPS_BLENDFACTOR is on
145 D3DBLEND_INVBLENDFACTOR = 15 'Only supported if D3DPBLENDCAPS_BLENDFACTOR is on
146
147 D3DBLEND_FORCE_DWORD = &H7FFFFFFF
148End Enum
149
150Const Enum D3DBLENDOP
151 D3DBLENDOP_ADD = 1
152 D3DBLENDOP_SUBTRACT = 2
153 D3DBLENDOP_REVSUBTRACT = 3
154 D3DBLENDOP_MIN = 4
155 D3DBLENDOP_MAX = 5
156 D3DBLENDOP_FORCE_DWORD = &H7FFFFFFF
157End Enum
158
159Const Enum D3DTEXTUREADDRESS
160 D3DTADDRESS_WRAP = 1
161 D3DTADDRESS_MIRROR = 2
162 D3DTADDRESS_CLAMP = 3
163 D3DTADDRESS_BORDER = 4
164 D3DTADDRESS_MIRRORONCE = 5
165 D3DTADDRESS_FORCE_DWORD = &H7FFFFFFF
166End Enum
167
168Const Enum D3DCULL
169 D3DCULL_NONE = 1
170 D3DCULL_CW = 2
171 D3DCULL_CCW = 3
172 D3DCULL_FORCE_DWORD = &H7FFFFFFF
173End Enum
174
175Const Enum D3DCMPFUNC
176 D3DCMP_NEVER = 1
177 D3DCMP_LESS = 2
178 D3DCMP_EQUAL = 3
179 D3DCMP_LESSEQUAL = 4
180 D3DCMP_GREATER = 5
181 D3DCMP_NOTEQUAL = 6
182 D3DCMP_GREATEREQUAL = 7
183 D3DCMP_ALWAYS = 8
184 D3DCMP_FORCE_DWORD = &H7FFFFFFF
185End Enum
186
187Const Enum D3DSTENCILOP
188 D3DSTENCILOP_KEEP = 1
189 D3DSTENCILOP_ZERO = 2
190 D3DSTENCILOP_REPLACE = 3
191 D3DSTENCILOP_INCRSAT = 4
192 D3DSTENCILOP_DECRSAT = 5
193 D3DSTENCILOP_INVERT = 6
194 D3DSTENCILOP_INCR = 7
195 D3DSTENCILOP_DECR = 8
196 D3DSTENCILOP_FORCE_DWORD = &H7FFFFFFF
197End Enum
198
199Const Enum D3DFOGMODE
200 D3DFOG_NONE = 0
201 D3DFOG_EXP = 1
202 D3DFOG_EXP2 = 2
203 D3DFOG_LINEAR = 3
204 D3DFOG_FORCE_DWORD = &H7FFFFFFF
205End Enum
206
207Const Enum D3DZBUFFERTYPE
208 D3DZB_FALSE = 0
209 D3DZB_TRUE = 1 'Z buffering
210 D3DZB_USEW = 2 'W buffering
211 D3DZB_FORCE_DWORD = &H7FFFFFFF
212End Enum
213
214' Primitives supported by draw-primitive API
215Const Enum D3DPRIMITIVETYPE
216 D3DPT_POINTLIST = 1
217 D3DPT_LINELIST = 2
218 D3DPT_LINESTRIP = 3
219 D3DPT_TRIANGLELIST = 4
220 D3DPT_TRIANGLESTRIP = 5
221 D3DPT_TRIANGLEFAN = 6
222 D3DPT_FORCE_DWORD = &H7FFFFFFF
223End Enum
224
225
226Const D3DTS_WORLDMATRIX(index) = index + 256
227Const Enum D3DTRANSFORMSTATETYPE
228 D3DTS_VIEW = 2
229 D3DTS_PROJECTION = 3
230 D3DTS_TEXTURE0 = 16
231 D3DTS_TEXTURE1 = 17
232 D3DTS_TEXTURE2 = 18
233 D3DTS_TEXTURE3 = 19
234 D3DTS_TEXTURE4 = 20
235 D3DTS_TEXTURE5 = 21
236 D3DTS_TEXTURE6 = 22
237 D3DTS_TEXTURE7 = 23
238 D3DTS_WORLD = D3DTS_WORLDMATRIX(0)
239 D3DTS_WORLD1 = D3DTS_WORLDMATRIX(1)
240 D3DTS_WORLD2 = D3DTS_WORLDMATRIX(2)
241 D3DTS_WORLD3 = D3DTS_WORLDMATRIX(3)
242 D3DTS_FORCE_DWORD = &H7FFFFFFF
243End Enum
244
245Const Enum D3DRENDERSTATETYPE
246 D3DRS_ZENABLE = 7 'D3DZBUFFERTYPE (or TRUE/FALSE for legacy)
247 D3DRS_FILLMODE = 8 'D3DFILLMODE
248 D3DRS_SHADEMODE = 9 'D3DSHADEMODE
249 D3DRS_ZWRITEENABLE = 14 'TRUE to enable z writes
250 D3DRS_ALPHATESTENABLE = 15 'TRUE to enable alpha tests
251 D3DRS_LASTPIXEL = 16 'TRUE for last-pixel on lines
252 D3DRS_SRCBLEND = 19 'D3DBLEND
253 D3DRS_DESTBLEND = 20 'D3DBLEND
254 D3DRS_CULLMODE = 22 'D3DCULL
255 D3DRS_ZFUNC = 23 'D3DCMPFUNC
256 D3DRS_ALPHAREF = 24 'D3DFIXED
257 D3DRS_ALPHAFUNC = 25 'D3DCMPFUNC
258 D3DRS_DITHERENABLE = 26 'TRUE to enable dithering
259 D3DRS_ALPHABLENDENABLE = 27 'TRUE to enable alpha blending
260 D3DRS_FOGENABLE = 28 'TRUE to enable fog blending
261 D3DRS_SPECULARENABLE = 29 'TRUE to enable specular
262 D3DRS_FOGCOLOR = 34 'D3DCOLOR
263 D3DRS_FOGTABLEMODE = 35 'D3DFOGMODE
264 D3DRS_FOGSTART = 36 'Fog start (for both vertex and pixel fog)
265 D3DRS_FOGEND = 37 'Fog end
266 D3DRS_FOGDENSITY = 38 'Fog density
267 D3DRS_RANGEFOGENABLE = 48 'Enables range-based fog
268 D3DRS_STENCILENABLE = 52 'BOOL enable/disable stenciling
269 D3DRS_STENCILFAIL = 53 'D3DSTENCILOP to do if stencil test fails
270 D3DRS_STENCILZFAIL = 54 'D3DSTENCILOP to do if stencil test passes and Z test fails
271 D3DRS_STENCILPASS = 55 'D3DSTENCILOP to do if both stencil and Z tests pass
272 D3DRS_STENCILFUNC = 56 'D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true
273 D3DRS_STENCILREF = 57 'Reference value used in stencil test
274 D3DRS_STENCILMASK = 58 'Mask value used in stencil test
275 D3DRS_STENCILWRITEMASK = 59 'Write mask applied to values written to stencil buffer
276 D3DRS_TEXTUREFACTOR = 60 'D3DCOLOR used for multi-texture blend
277 D3DRS_WRAP0 = 128 'wrap for 1st texture coord. set
278 D3DRS_WRAP1 = 129 'wrap for 2nd texture coord. set
279 D3DRS_WRAP2 = 130 'wrap for 3rd texture coord. set
280 D3DRS_WRAP3 = 131 'wrap for 4th texture coord. set
281 D3DRS_WRAP4 = 132 'wrap for 5th texture coord. set
282 D3DRS_WRAP5 = 133 'wrap for 6th texture coord. set
283 D3DRS_WRAP6 = 134 'wrap for 7th texture coord. set
284 D3DRS_WRAP7 = 135 'wrap for 8th texture coord. set
285 D3DRS_CLIPPING = 136
286 D3DRS_LIGHTING = 137
287 D3DRS_AMBIENT = 139
288 D3DRS_FOGVERTEXMODE = 140
289 D3DRS_COLORVERTEX = 141
290 D3DRS_LOCALVIEWER = 142
291 D3DRS_NORMALIZENORMALS = 143
292 D3DRS_DIFFUSEMATERIALSOURCE = 145
293 D3DRS_SPECULARMATERIALSOURCE = 146
294 D3DRS_AMBIENTMATERIALSOURCE = 147
295 D3DRS_EMISSIVEMATERIALSOURCE = 148
296 D3DRS_VERTEXBLEND = 151
297 D3DRS_CLIPPLANEENABLE = 152
298 D3DRS_POINTSIZE = 154 'float point size
299 D3DRS_POINTSIZE_MIN = 155 'float point size min threshold
300 D3DRS_POINTSPRITEENABLE = 156 'BOOL point texture coord control
301 D3DRS_POINTSCALEENABLE = 157 'BOOL point size scale enable
302 D3DRS_POINTSCALE_A = 158 'float point attenuation A value
303 D3DRS_POINTSCALE_B = 159 'float point attenuation B value
304 D3DRS_POINTSCALE_C = 160 'float point attenuation C value
305 D3DRS_MULTISAMPLEANTIALIAS = 161 ' BOOL - set to do FSAA with multisample buffer
306 D3DRS_MULTISAMPLEMASK = 162 ' DWORD - per-sample enable/disable
307 D3DRS_PATCHEDGESTYLE = 163 ' Sets whether patch edges will use float style tessellation
308 D3DRS_DEBUGMONITORTOKEN = 165 ' DEBUG ONLY - token to debug monitor
309 D3DRS_POINTSIZE_MAX = 166 'float point size max threshold
310 D3DRS_INDEXEDVERTEXBLENDENABLE = 167
311 D3DRS_COLORWRITEENABLE = 168 ' per-channel write enable
312 D3DRS_TWEENFACTOR = 170 ' float tween factor
313 D3DRS_BLENDOP = 171 ' D3DBLENDOP setting
314 D3DRS_POSITIONDEGREE = 172 ' NPatch position interpolation degree. D3DDEGREE_LINEAR or D3DDEGREE_CUBIC (default)
315 D3DRS_NORMALDEGREE = 173 ' NPatch normal interpolation degree. D3DDEGREE_LINEAR (default) or D3DDEGREE_QUADRATIC
316 D3DRS_SCISSORTESTENABLE = 174
317 D3DRS_SLOPESCALEDEPTHBIAS = 175
318 D3DRS_ANTIALIASEDLINEENABLE = 176
319 D3DRS_MINTESSELLATIONLEVEL = 178
320 D3DRS_MAXTESSELLATIONLEVEL = 179
321 D3DRS_ADAPTIVETESS_X = 180
322 D3DRS_ADAPTIVETESS_Y = 181
323 D3DRS_ADAPTIVETESS_Z = 182
324 D3DRS_ADAPTIVETESS_W = 183
325 D3DRS_ENABLEADAPTIVETESSELLATION = 184
326 D3DRS_TWOSIDEDSTENCILMODE = 185 'BOOL enable/disable 2 sided stenciling
327 D3DRS_CCW_STENCILFAIL = 186 'D3DSTENCILOP to do if ccw stencil test fails
328 D3DRS_CCW_STENCILZFAIL = 187 'D3DSTENCILOP to do if ccw stencil test passes and Z test fails
329 D3DRS_CCW_STENCILPASS = 188 'D3DSTENCILOP to do if both ccw stencil and Z tests pass
330 D3DRS_CCW_STENCILFUNC = 189 'D3DCMPFUNC fn. ccw Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true
331 D3DRS_COLORWRITEENABLE1 = 190 'Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS
332 D3DRS_COLORWRITEENABLE2 = 191 'Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS
333 D3DRS_COLORWRITEENABLE3 = 192 'Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS
334 D3DRS_BLENDFACTOR = 193 'D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR
335 D3DRS_SRGBWRITEENABLE = 194 'Enable rendertarget writes to be DE-linearized to SRGB (for formats that expose D3DUSAGE_QUERY_SRGBWRITE)
336 D3DRS_DEPTHBIAS = 195
337 D3DRS_WRAP8 = 198 'Additional wrap states for vs_3_0+ attributes with D3DDECLUSAGE_TEXCOORD
338 D3DRS_WRAP9 = 199
339 D3DRS_WRAP10 = 200
340 D3DRS_WRAP11 = 201
341 D3DRS_WRAP12 = 202
342 D3DRS_WRAP13 = 203
343 D3DRS_WRAP14 = 204
344 D3DRS_WRAP15 = 205
345 D3DRS_SEPARATEALPHABLENDENABLE = 206 'TRUE to enable a separate blending function for the alpha channel
346 D3DRS_SRCBLENDALPHA = 207 'SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE
347 D3DRS_DESTBLENDALPHA = 208 'DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE
348 D3DRS_BLENDOPALPHA = 209 'Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE
349 D3DRS_FORCE_DWORD = &H7FFFFFFF
350End Enum
351
352' Values for material source
353Const Enum D3DMATERIALCOLORSOURCE
354 D3DMCS_MATERIAL = 0 'Color from material is used
355 D3DMCS_COLOR1 = 1 'Diffuse vertex color is used
356 D3DMCS_COLOR2 = 2 'Specular vertex color is used
357 D3DMCS_FORCE_DWORD = &H7FFFFFFF
358End Enum
359
360' Bias to apply to the texture coordinate set to apply a wrap to.
361Const D3DRENDERSTATE_WRAPBIAS = 128
362
363' Flags to construct the WRAP render states
364Const D3DWRAP_U = &H00000001
365Const D3DWRAP_V = &H00000002
366Const D3DWRAP_W = &H00000004
367
368' Flags to construct the WRAP render states for 1D thru 4D texture coordinates
369Const D3DWRAPCOORD_0 = &H00000001 'same as D3DWRAP_U
370Const D3DWRAPCOORD_1 = &H00000002 'same as D3DWRAP_V
371Const D3DWRAPCOORD_2 = &H00000004 'same as D3DWRAP_W
372Const D3DWRAPCOORD_3 = &H00000008
373
374' Flags to construct D3DRS_COLORWRITEENABLE
375Const D3DCOLORWRITEENABLE_RED = 1<<0
376Const D3DCOLORWRITEENABLE_GREEN = 1<<1
377Const D3DCOLORWRITEENABLE_BLUE = 1<<2
378Const D3DCOLORWRITEENABLE_ALPHA = 1<<3
379
380
381' State enumerants for per-stage processing of fixed function pixel processing
382' Two of these affect fixed function vertex processing as well: TEXTURETRANSFORMFLAGS and TEXCOORDINDEX.
383Const Enum D3DTEXTURESTAGESTATETYPE
384 D3DTSS_COLOROP = 1 'D3DTEXTUREOP - per-stage blending controls for color channels
385 D3DTSS_COLORARG1 = 2 'D3DTA_* (texture arg)
386 D3DTSS_COLORARG2 = 3 'D3DTA_* (texture arg)
387 D3DTSS_ALPHAOP = 4 'D3DTEXTUREOP - per-stage blending controls for alpha channel
388 D3DTSS_ALPHAARG1 = 5 'D3DTA_* (texture arg)
389 D3DTSS_ALPHAARG2 = 6 'D3DTA_* (texture arg)
390 D3DTSS_BUMPENVMAT00 = 7 'float (bump mapping matrix)
391 D3DTSS_BUMPENVMAT01 = 8 'float (bump mapping matrix)
392 D3DTSS_BUMPENVMAT10 = 9 'float (bump mapping matrix)
393 D3DTSS_BUMPENVMAT11 = 10 'float (bump mapping matrix)
394 D3DTSS_TEXCOORDINDEX = 11 'identifies which set of texture coordinates index this texture
395 D3DTSS_BUMPENVLSCALE = 22 'float scale for bump map luminance
396 D3DTSS_BUMPENVLOFFSET = 23 'float offset for bump map luminance
397 D3DTSS_TEXTURETRANSFORMFLAGS = 24 'D3DTEXTURETRANSFORMFLAGS controls texture transform
398 D3DTSS_COLORARG0 = 26 'D3DTA_* third arg for triadic ops
399 D3DTSS_ALPHAARG0 = 27 'D3DTA_* third arg for triadic ops
400 D3DTSS_RESULTARG = 28 'D3DTA_* arg for result (CURRENT or TEMP)
401 D3DTSS_CONSTANT = 32 'Per-stage constant D3DTA_CONSTANT
402
403 D3DTSS_FORCE_DWORD = &H7FFFFFFF
404End Enum
405
406
407' State enumerants for per-sampler texture processing.
408Const Enum D3DSAMPLERSTATETYPE
409 D3DSAMP_ADDRESSU = 1 'D3DTEXTUREADDRESS for U coordinate
410 D3DSAMP_ADDRESSV = 2 'D3DTEXTUREADDRESS for V coordinate
411 D3DSAMP_ADDRESSW = 3 'D3DTEXTUREADDRESS for W coordinate
412 D3DSAMP_BORDERCOLOR = 4 'D3DCOLOR
413 D3DSAMP_MAGFILTER = 5 'D3DTEXTUREFILTER filter to use for magnification
414 D3DSAMP_MINFILTER = 6 'D3DTEXTUREFILTER filter to use for minification
415 D3DSAMP_MIPFILTER = 7 'D3DTEXTUREFILTER filter to use between mipmaps during minification
416 D3DSAMP_MIPMAPLODBIAS = 8 'float Mipmap LOD bias
417 D3DSAMP_MAXMIPLEVEL = 9 'DWORD 0..(n-1) LOD index of largest map to use (0 == largest)
418 D3DSAMP_MAXANISOTROPY = 10 'DWORD maximum anisotropy
419 D3DSAMP_SRGBTEXTURE = 11 'Default = 0 (which means Gamma 1.0,
420 ' no correction required.) else correct for
421 ' Gamma = 2.2
422 D3DSAMP_ELEMENTINDEX = 12 'When multi-element texture is assigned to sampler, this
423 ' indicates which element index to use. Default = 0.
424 D3DSAMP_DMAPOFFSET = 13 'Offset in vertices in the pre-sampled displacement map.
425 ' Only valid for D3DDMAPSAMPLER sampler
426
427 D3DSAMP_FORCE_DWORD = &H7FFFFFFF
428End Enum
429
430' Special sampler which is used in the tesselator
431Const D3DDMAPSAMPLER = 256
432
433' Samplers used in vertex shaders
434Const D3DVERTEXTEXTURESAMPLER0 = D3DDMAPSAMPLER+1
435Const D3DVERTEXTEXTURESAMPLER1 = D3DDMAPSAMPLER+2
436Const D3DVERTEXTEXTURESAMPLER2 = D3DDMAPSAMPLER+3
437Const D3DVERTEXTEXTURESAMPLER3 = D3DDMAPSAMPLER+4
438
439' Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
440' and normal in the camera space) should be taken as texture coordinates
441' Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
442Const D3DTSS_TCI_PASSTHRU = &H00000000
443Const D3DTSS_TCI_CAMERASPACENORMAL = &H00010000
444Const D3DTSS_TCI_CAMERASPACEPOSITION = &H00020000
445Const D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR = &H00030000
446Const D3DTSS_TCI_SPHEREMAP = &H00040000
447
448
449' Enumerations for COLOROP and ALPHAOP texture blending operations set in
450' texture processing stage controls in D3DTSS.
451Const Enum D3DTEXTUREOP
452 'Control
453 D3DTOP_DISABLE = 1 'disables stage
454 D3DTOP_SELECTARG1 = 2 'the default
455 D3DTOP_SELECTARG2 = 3
456
457 'Modulate
458 D3DTOP_MODULATE = 4 'multiply args together
459 D3DTOP_MODULATE2X = 5 'multiply and 1 bit
460 D3DTOP_MODULATE4X = 6 'multiply and 2 bits
461
462 'Add
463 D3DTOP_ADD = 7 'add arguments together
464 D3DTOP_ADDSIGNED = 8 'add with -0.5 bias
465 D3DTOP_ADDSIGNED2X = 9 'as above but left 1 bit
466 D3DTOP_SUBTRACT = 10 'Arg1 - Arg2, with no saturation
467 D3DTOP_ADDSMOOTH = 11 'add 2 args, subtract product
468 'Arg1 + Arg2 - Arg1*Arg2
469 '= Arg1 + (1-Arg1)*Arg2
470
471 'Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
472 D3DTOP_BLENDDIFFUSEALPHA = 12 'iterated alpha
473 D3DTOP_BLENDTEXTUREALPHA = 13 'texture alpha
474 D3DTOP_BLENDFACTORALPHA = 14 'alpha from D3DRS_TEXTUREFACTOR
475
476 'Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
477 D3DTOP_BLENDTEXTUREALPHAPM = 15 'texture alpha
478 D3DTOP_BLENDCURRENTALPHA = 16 'by alpha of current color
479
480 'Specular mapping
481 D3DTOP_PREMODULATE = 17 'modulate with next texture before use
482 D3DTOP_MODULATEALPHA_ADDCOLOR = 18 'Arg1.RGB + Arg1.A*Arg2.RGB
483 'COLOROP only
484 D3DTOP_MODULATECOLOR_ADDALPHA = 19 'Arg1.RGB*Arg2.RGB + Arg1.A
485 'COLOROP only
486 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20 '(1-Arg1.A)*Arg2.RGB + Arg1.RGB
487 'COLOROP only
488 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21 '(1-Arg1.RGB)*Arg2.RGB + Arg1.A
489 'COLOROP only
490
491 'Bump mapping
492 D3DTOP_BUMPENVMAP = 22 'per pixel env map perturbation
493 D3DTOP_BUMPENVMAPLUMINANCE = 23 'with luminance channel
494
495 'This can do either diffuse or specular bump mapping with correct input.
496 'Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
497 'where each component has been scaled and offset to make it signed.
498 'The result is replicated into all four (including alpha) channels.
499 'This is a valid COLOROP only.
500 D3DTOP_DOTPRODUCT3 = 24
501
502 'Triadic ops
503 D3DTOP_MULTIPLYADD = 25 'Arg0 + Arg1*Arg2
504 D3DTOP_LERP = 26 '(Arg0)*Arg1 + (1-Arg0)*Arg2
505
506 D3DTOP_FORCE_DWORD = &H7FFFFFFF
507End Enum
508
509
510' Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending
511' operations set in texture processing stage controls in D3DRENDERSTATE.
512Const D3DTA_SELECTMASK = &H0000000f 'mask for arg selector
513Const D3DTA_DIFFUSE = &H00000000 'select diffuse color (read only)
514Const D3DTA_CURRENT = &H00000001 'select stage destination register (read/write)
515Const D3DTA_TEXTURE = &H00000002 'select texture color (read only)
516Const D3DTA_TFACTOR = &H00000003 'select D3DRS_TEXTUREFACTOR (read only)
517Const D3DTA_SPECULAR = &H00000004 'select specular color (read only)
518Const D3DTA_TEMP = &H00000005 'select temporary register color (read/write)
519Const D3DTA_CONSTANT = &H00000006 'select texture stage constant
520Const D3DTA_COMPLEMENT = &H00000010 'take 1.0 - x (read modifier)
521Const D3DTA_ALPHAREPLICATE = &H00000020 'replicate alpha to color components (read modifier)
522
523
524' Values for D3DSAMP_***FILTER texture stage states
525Const Enum D3DTEXTUREFILTERTYPE
526 D3DTEXF_NONE = 0 ' filtering disabled (valid for mip filter only)
527 D3DTEXF_POINT = 1 ' nearest
528 D3DTEXF_LINEAR = 2 ' linear interpolation
529 D3DTEXF_ANISOTROPIC = 3 ' anisotropic
530 D3DTEXF_PYRAMIDALQUAD = 6 ' 4-sample tent
531 D3DTEXF_GAUSSIANQUAD = 7 ' 4-sample gaussian
532 D3DTEXF_FORCE_DWORD = &H7FFFFFFF ' force 32-bit size enum
533End Enum
534
535' Bits for Flags in ProcessVertices call
536Const D3DPV_DONOTCOPYDATA = 1<<0
537
538
539'Flexible vertex format bits
540Const D3DFVF_RESERVED0 = &H001
541Const D3DFVF_POSITION_MASK = &H400E
542Const D3DFVF_XYZ = &H002
543Const D3DFVF_XYZRHW = &H004
544Const D3DFVF_XYZB1 = &H006
545Const D3DFVF_XYZB2 = &H008
546Const D3DFVF_XYZB3 = &H00a
547Const D3DFVF_XYZB4 = &H00c
548Const D3DFVF_XYZB5 = &H00e
549Const D3DFVF_XYZW = &H4002
550
551Const D3DFVF_NORMAL = &H010
552Const D3DFVF_PSIZE = &H020
553Const D3DFVF_DIFFUSE = &H040
554Const D3DFVF_SPECULAR = &H080
555
556Const D3DFVF_TEXCOUNT_MASK = &Hf00
557Const D3DFVF_TEXCOUNT_SHIFT = &H8
558Const D3DFVF_TEX0 = &H000
559Const D3DFVF_TEX1 = &H100
560Const D3DFVF_TEX2 = &H200
561Const D3DFVF_TEX3 = &H300
562Const D3DFVF_TEX4 = &H400
563Const D3DFVF_TEX5 = &H500
564Const D3DFVF_TEX6 = &H600
565Const D3DFVF_TEX7 = &H700
566Const D3DFVF_TEX8 = &H800
567
568Const D3DFVF_LASTBETA_UBYTE4 = &H1000
569Const D3DFVF_LASTBETA_D3DCOLOR = &H8000
570
571Const D3DFVF_RESERVED2 = &H6000 '2 reserved bits
572
573
574' Vertex element semantics
575Const Enum D3DDECLUSAGE
576 D3DDECLUSAGE_POSITION = 0
577 D3DDECLUSAGE_BLENDWEIGHT = 1
578 D3DDECLUSAGE_BLENDINDICES = 2
579 D3DDECLUSAGE_NORMAL = 3
580 D3DDECLUSAGE_PSIZE = 4
581 D3DDECLUSAGE_TEXCOORD = 5
582 D3DDECLUSAGE_TANGENT = 6
583 D3DDECLUSAGE_BINORMAL = 7
584 D3DDECLUSAGE_TESSFACTOR = 8
585 D3DDECLUSAGE_POSITIONT = 9
586 D3DDECLUSAGE_COLOR = 10
587 D3DDECLUSAGE_FOG = 11
588 D3DDECLUSAGE_DEPTH = 12
589 D3DDECLUSAGE_SAMPLE = 13
590End Enum
591
592Const Enum D3DDECLMETHOD
593 D3DDECLMETHOD_DEFAULT = 0
594 D3DDECLMETHOD_PARTIALU = 1
595 D3DDECLMETHOD_PARTIALV = 2
596 D3DDECLMETHOD_CROSSUV = 3 'Normal
597 D3DDECLMETHOD_UV = 4
598 D3DDECLMETHOD_LOOKUP = 5 'Lookup a displacement map
599 D3DDECLMETHOD_LOOKUPPRESAMPLED = 6 'Lookup a pre-sampled displacement map
600End Enum
601
602' Declarations for _Type fields
603Const Enum D3DDECLTYPE
604 D3DDECLTYPE_FLOAT1 = 0 '1D float expanded to (value, 0., 0., 1.)
605 D3DDECLTYPE_FLOAT2 = 1 '2D float expanded to (value, value, 0., 1.)
606 D3DDECLTYPE_FLOAT3 = 2 '3D float expanded to (value, value, value, 1.)
607 D3DDECLTYPE_FLOAT4 = 3 '4D float
608 D3DDECLTYPE_D3DCOLOR = 4 '4D packed unsigned bytes mapped to 0. to 1. range
609 'Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A)
610 D3DDECLTYPE_UBYTE4 = 5 '4D unsigned byte
611 D3DDECLTYPE_SHORT2 = 6 '2D signed short expanded to (value, value, 0., 1.)
612 D3DDECLTYPE_SHORT4 = 7 '4D signed short
613
614'The following types are valid only with vertex shaders >= 2.0
615 D3DDECLTYPE_UBYTE4N = 8 'Each of 4 bytes is normalized by dividing to 255.0
616 D3DDECLTYPE_SHORT2N = 9 '2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1)
617 D3DDECLTYPE_SHORT4N = 10 '4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0)
618 D3DDECLTYPE_USHORT2N = 11 '2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1)
619 D3DDECLTYPE_USHORT4N = 12 '4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0)
620 D3DDECLTYPE_UDEC3 = 13 '3D unsigned 10 10 10 format expanded to (value, value, value, 1)
621 D3DDECLTYPE_DEC3N = 14 '3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1)
622 D3DDECLTYPE_FLOAT16_2 = 15 'Two 16-bit floating point values, expanded to (value, value, 0, 1)
623 D3DDECLTYPE_FLOAT16_4 = 16 'Four 16-bit floating point values
624 D3DDECLTYPE_UNUSED = 17 'When the type field in a decl is unused.
625End Enum
626
627Type D3DVERTEXELEMENT9
628 Stream As Word
629 Offset As Word
630 byType As Byte
631 Method As Byte
632 Usage As Byte
633 UsageIndex As Byte
634End Type
635
636' Maximum supported number of texture coordinate sets
637Const D3DDP_MAXTEXCOORD = 8
638
639
640' Values for IDirect3DDevice9::SetStreamSourceFreq's Setting parameter
641Const D3DSTREAMSOURCE_INDEXEDDATA = 1<<30
642Const D3DSTREAMSOURCE_INSTANCEDATA = 2<<30
643
644Const D3DSP_TEXTURETYPE_SHIFT = 27
645Const Enum D3DSAMPLER_TEXTURE_TYPE
646 D3DSTT_UNKNOWN = 0<<D3DSP_TEXTURETYPE_SHIFT 'uninitialized value
647 D3DSTT_2D = 2<<D3DSP_TEXTURETYPE_SHIFT 'dcl_2d s# (for declaring a 2-D texture)
648 D3DSTT_CUBE = 3<<D3DSP_TEXTURETYPE_SHIFT 'dcl_cube s# (for declaring a cube texture)
649 D3DSTT_VOLUME = 4<<D3DSP_TEXTURETYPE_SHIFT 'dcl_volume s# (for declaring a volume texture)
650 D3DSTT_FORCE_DWORD = &H7FFFFFFF
651End Enum
652
653
654' pixel shader version token
655Const D3DPS_VERSION(_Major,_Minor) = &HFFFF0000 or (_Major<<8) or _Minor
656
657' vertex shader version token
658Const D3DVS_VERSION(_Major,_Minor) = &HFFFE0000 or (_Major<<8) or _Minor
659
660
661
662' High order surfaces
663Const Enum D3DBASISTYPE
664 D3DBASIS_BEZIER = 0
665 D3DBASIS_BSPLINE = 1
666 D3DBASIS_CATMULL_ROM = 2 ' In D3D8 this used to be D3DBASIS_INTERPOLATE
667 D3DBASIS_FORCE_DWORD = &H7FFFFFFF
668End Enum
669
670Const Enum D3DDEGREETYPE
671 D3DDEGREE_LINEAR = 1
672 D3DDEGREE_QUADRATIC = 2
673 D3DDEGREE_CUBIC = 3
674 D3DDEGREE_QUINTIC = 5
675 D3DDEGREE_FORCE_DWORD = &H7FFFFFFF
676End Enum
677
678Const Enum D3DPATCHEDGESTYLE
679 D3DPATCHEDGE_DISCRETE = 0
680 D3DPATCHEDGE_CONTINUOUS = 1
681 D3DPATCHEDGE_FORCE_DWORD = &H7FFFFFFF
682End Enum
683
684Const Enum D3DSTATEBLOCKTYPE
685 D3DSBT_ALL = 1 'capture all state
686 D3DSBT_PIXELSTATE = 2 'capture pixel state
687 D3DSBT_VERTEXSTATE = 3 'capture vertex state
688 D3DSBT_FORCE_DWORD = &H7FFFFFFF
689End Enum
690
691' The D3DVERTEXBLENDFLAGS type is used with D3DRS_VERTEXBLEND state.
692Const Enum D3DVERTEXBLENDFLAGS
693 D3DVBF_DISABLE = 0 'Disable vertex blending
694 D3DVBF_1WEIGHTS = 1 '2 matrix blending
695 D3DVBF_2WEIGHTS = 2 '3 matrix blending
696 D3DVBF_3WEIGHTS = 3 '4 matrix blending
697 D3DVBF_TWEENING = 255 'blending using D3DRS_TWEENFACTOR
698 D3DVBF_0WEIGHTS = 256 'one matrix is used with weight 1.0
699 D3DVBF_FORCE_DWORD = &H7FFFFFFF
700End Enum
701
702Const Enum D3DTEXTURETRANSFORMFLAGS
703 D3DTTFF_DISABLE = 0 'texture coordinates are passed directly
704 D3DTTFF_COUNT1 = 1 'rasterizer should expect 1-D texture coords
705 D3DTTFF_COUNT2 = 2 'rasterizer should expect 2-D texture coords
706 D3DTTFF_COUNT3 = 3 'rasterizer should expect 3-D texture coords
707 D3DTTFF_COUNT4 = 4 'rasterizer should expect 4-D texture coords
708 D3DTTFF_PROJECTED = 256 'texcoords to be divided by COUNTth element
709 D3DTTFF_FORCE_DWORD = &H7FFFFFFF
710End Enum
711
712' Macros to set texture coordinate format bits in the FVF id
713Const D3DFVF_TEXTUREFORMAT2 = 0 'Two floating point values
714Const D3DFVF_TEXTUREFORMAT1 = 3 'One floating point value
715Const D3DFVF_TEXTUREFORMAT3 = 1 'Three floating point values
716Const D3DFVF_TEXTUREFORMAT4 = 2 'Four floating point values
717
718Const D3DFVF_TEXCOORDSIZE3(CoordIndex) = D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)
719Const D3DFVF_TEXCOORDSIZE2(CoordIndex) = D3DFVF_TEXTUREFORMAT2
720Const D3DFVF_TEXCOORDSIZE4(CoordIndex) = D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)
721Const D3DFVF_TEXCOORDSIZE1(CoordIndex) = D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)
722
723
724' Direct3D9 Device types
725Const Enum D3DDEVTYPE
726 D3DDEVTYPE_HAL = 1
727 D3DDEVTYPE_REF = 2
728 D3DDEVTYPE_SW = 3
729
730 D3DDEVTYPE_NULLREF = 4
731
732 D3DDEVTYPE_FORCE_DWORD = &H7FFFFFFF
733End Enum
734
735
736' Multi-Sample buffer types
737Const Enum D3DMULTISAMPLE_TYPE
738 D3DMULTISAMPLE_NONE = 0
739 D3DMULTISAMPLE_NONMASKABLE = 1
740 D3DMULTISAMPLE_2_SAMPLES = 2
741 D3DMULTISAMPLE_3_SAMPLES = 3
742 D3DMULTISAMPLE_4_SAMPLES = 4
743 D3DMULTISAMPLE_5_SAMPLES = 5
744 D3DMULTISAMPLE_6_SAMPLES = 6
745 D3DMULTISAMPLE_7_SAMPLES = 7
746 D3DMULTISAMPLE_8_SAMPLES = 8
747 D3DMULTISAMPLE_9_SAMPLES = 9
748 D3DMULTISAMPLE_10_SAMPLES = 10
749 D3DMULTISAMPLE_11_SAMPLES = 11
750 D3DMULTISAMPLE_12_SAMPLES = 12
751 D3DMULTISAMPLE_13_SAMPLES = 13
752 D3DMULTISAMPLE_14_SAMPLES = 14
753 D3DMULTISAMPLE_15_SAMPLES = 15
754 D3DMULTISAMPLE_16_SAMPLES = 16
755
756 D3DMULTISAMPLE_FORCE_DWORD = &H7FFFFFFF
757End Enum
758
759Const Enum D3DFORMAT
760 D3DFMT_UNKNOWN = 0
761
762 D3DFMT_R8G8B8 = 20
763 D3DFMT_A8R8G8B8 = 21
764 D3DFMT_X8R8G8B8 = 22
765 D3DFMT_R5G6B5 = 23
766 D3DFMT_X1R5G5B5 = 24
767 D3DFMT_A1R5G5B5 = 25
768 D3DFMT_A4R4G4B4 = 26
769 D3DFMT_R3G3B2 = 27
770 D3DFMT_A8 = 28
771 D3DFMT_A8R3G3B2 = 29
772 D3DFMT_X4R4G4B4 = 30
773 D3DFMT_A2B10G10R10 = 31
774 D3DFMT_A8B8G8R8 = 32
775 D3DFMT_X8B8G8R8 = 33
776 D3DFMT_G16R16 = 34
777 D3DFMT_A2R10G10B10 = 35
778 D3DFMT_A16B16G16R16 = 36
779
780 D3DFMT_A8P8 = 40
781 D3DFMT_P8 = 41
782
783 D3DFMT_L8 = 50
784 D3DFMT_A8L8 = 51
785 D3DFMT_A4L4 = 52
786
787 D3DFMT_V8U8 = 60
788 D3DFMT_L6V5U5 = 61
789 D3DFMT_X8L8V8U8 = 62
790 D3DFMT_Q8W8V8U8 = 63
791 D3DFMT_V16U16 = 64
792 D3DFMT_A2W10V10U10 = 67
793
794 D3DFMT_UYVY = &H59565955 'MAKEFOURCC('U', 'Y', 'V', 'Y'),
795 D3DFMT_R8G8_B8G8 = &H47424752 'MAKEFOURCC('R', 'G', 'B', 'G'),
796 D3DFMT_YUY2 = &H32595559 'MAKEFOURCC('Y', 'U', 'Y', '2'),
797 D3DFMT_G8R8_G8B8 = &H42475247 'MAKEFOURCC('G', 'R', 'G', 'B'),
798 D3DFMT_DXT1 = &H31545844 'MAKEFOURCC('D', 'X', 'T', '1'),
799 D3DFMT_DXT2 = &H32545844 'MAKEFOURCC('D', 'X', 'T', '2'),
800 D3DFMT_DXT3 = &H33545844 'MAKEFOURCC('D', 'X', 'T', '3'),
801 D3DFMT_DXT4 = &H34545844 'MAKEFOURCC('D', 'X', 'T', '4'),
802 D3DFMT_DXT5 = &H35545844 'MAKEFOURCC('D', 'X', 'T', '5'),
803
804 D3DFMT_D16_LOCKABLE = 70
805 D3DFMT_D32 = 71
806 D3DFMT_D15S1 = 73
807 D3DFMT_D24S8 = 75
808 D3DFMT_D24X8 = 77
809 D3DFMT_D24X4S4 = 79
810 D3DFMT_D16 = 80
811
812 D3DFMT_D32F_LOCKABLE = 82
813 D3DFMT_D24FS8 = 83
814
815
816 D3DFMT_L16 = 81
817
818 D3DFMT_VERTEXDATA =100
819 D3DFMT_INDEX16 =101
820 D3DFMT_INDEX32 =102
821
822 D3DFMT_Q16W16V16U16 =110
823
824 D3DFMT_MULTI2_ARGB8 = &H3154454D 'MAKEFOURCC('M','E','T','1')
825
826 ' Floating point surface formats
827
828 ' s10e5 formats (16-bits per channel)
829 D3DFMT_R16F = 111
830 D3DFMT_G16R16F = 112
831 D3DFMT_A16B16G16R16F = 113
832
833 ' IEEE s23e8 formats (32-bits per channel)
834 D3DFMT_R32F = 114
835 D3DFMT_G32R32F = 115
836 D3DFMT_A32B32G32R32F = 116
837
838 D3DFMT_CxV8U8 = 117
839
840
841 D3DFMT_FORCE_DWORD = &H7FFFFFFF
842End Enum
843
844Type D3DDISPLAYMODE
845 Width As DWord
846 Height As DWord
847 RefreshRate As DWord
848 Format As D3DFORMAT
849End Type
850
851' Creation Parameters
852Type D3DDEVICE_CREATION_PARAMETERS
853 AdapterOrdinal As DWord
854 DeviceType As DWord
855 hFocusWindow As DWord
856 BehaviorFlags As DWord
857End Type
858
859' SwapEffects
860Const Enum D3DSWAPEFFECT
861 D3DSWAPEFFECT_DISCARD = 1
862 D3DSWAPEFFECT_FLIP = 2
863 D3DSWAPEFFECT_COPY = 3
864
865 D3DSWAPEFFECT_FORCE_DWORD = &H7FFFFFFF
866End Enum
867
868' Pool types
869Const Enum D3DPOOL
870 D3DPOOL_DEFAULT = 0
871 D3DPOOL_MANAGED = 1
872 D3DPOOL_SYSTEMMEM = 2
873 D3DPOOL_SCRATCH = 3
874
875 D3DPOOL_FORCE_DWORD = &H7FFFFFFF
876End Enum
877
878'RefreshRate pre-defines
879Const D3DPRESENT_RATE_DEFAULT = &H00000000
880
881' Resize Optional Parameters
882Type D3DPRESENT_PARAMETERS
883 BackBufferWidth As DWord
884 BackBufferHeight As DWord
885 BackBufferFormat As D3DFORMAT
886 BackBufferCount As DWord
887
888 MultiSampleType As D3DMULTISAMPLE_TYPE
889 MultiSampleQuality As DWord
890
891 SwapEffect As D3DSWAPEFFECT
892 hDeviceWindow As HWND
893 Windowed As Long
894 EnableAutoDepthStencil As Long
895 AutoDepthStencilFormat As D3DFORMAT
896 Flags As DWord
897
898 'FullScreen_RefreshRateInHz must be zero for Windowed mode
899 FullScreen_RefreshRateInHz As DWord
900 PresentationInterval As DWord
901End Type
902
903' Values for D3DPRESENT_PARAMETERS.Flags
904Const D3DPRESENTFLAG_LOCKABLE_BACKBUFFER = &H00000001
905Const D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL = &H00000002
906Const D3DPRESENTFLAG_DEVICECLIP = &H00000004
907Const D3DPRESENTFLAG_VIDEO = &H00000010
908
909' Gamma Ramp: Same as DX7
910Type D3DGAMMARAMP
911 red[255] As Word
912 green[255] As Word
913 blue[255] As Word
914End Type
915
916' Back buffer types
917Const Enum D3DBACKBUFFER_TYPE
918 D3DBACKBUFFER_TYPE_MONO = 0
919 D3DBACKBUFFER_TYPE_LEFT = 1
920 D3DBACKBUFFER_TYPE_RIGHT = 2
921
922 D3DBACKBUFFER_TYPE_FORCE_DWORD = &H7FFFFFFF
923End Enum
924
925Const Enum D3DRESOURCETYPE
926 D3DRTYPE_SURFACE = 1
927 D3DRTYPE_VOLUME = 2
928 D3DRTYPE_TEXTURE = 3
929 D3DRTYPE_VOLUMETEXTURE = 4
930 D3DRTYPE_CUBETEXTURE = 5
931 D3DRTYPE_VERTEXBUFFER = 6
932 D3DRTYPE_INDEXBUFFER = 7
933
934 D3DRTYPE_FORCE_DWORD = &H7FFFFFFF
935End Enum
936
937' Usages
938Const D3DUSAGE_RENDERTARGET = &H00000001
939Const D3DUSAGE_DEPTHSTENCIL = &H00000002
940Const D3DUSAGE_DYNAMIC = &H00000200
941
942' When passed to CheckDeviceFormat, D3DUSAGE_AUTOGENMIPMAP may return
943' D3DOK_NOAUTOGEN if the device doesn't support autogeneration for that format.
944' D3DOK_NOAUTOGEN is a success code, not a failure code... the SUCCEEDED and FAILED macros
945' will return true and false respectively for this code.
946Const D3DUSAGE_AUTOGENMIPMAP = &H00000400
947Const D3DUSAGE_DMAP = &H00004000
948
949' The following usages are valid only for querying CheckDeviceFormat
950Const D3DUSAGE_QUERY_LEGACYBUMPMAP = &H00008000
951Const D3DUSAGE_QUERY_SRGBREAD = &H00010000
952Const D3DUSAGE_QUERY_FILTER = &H00020000
953Const D3DUSAGE_QUERY_SRGBWRITE = &H00040000
954Const D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING = &H00080000
955Const D3DUSAGE_QUERY_VERTEXTEXTURE = &H00100000
956Const D3DUSAGE_QUERY_WRAPANDMIP = &H00200000
957
958' Usages for Vertex/Index buffers
959Const D3DUSAGE_WRITEONLY = &H00000008
960Const D3DUSAGE_SOFTWAREPROCESSING = &H00000010
961Const D3DUSAGE_DONOTCLIP = &H00000020
962Const D3DUSAGE_POINTS = &H00000040
963Const D3DUSAGE_RTPATCHES = &H00000080
964Const D3DUSAGE_NPATCHES = &H00000100
965
966
967
968' CubeMap Face identifiers
969Const Enum D3DCUBEMAP_FACES
970 D3DCUBEMAP_FACE_POSITIVE_X = 0
971 D3DCUBEMAP_FACE_NEGATIVE_X = 1
972 D3DCUBEMAP_FACE_POSITIVE_Y = 2
973 D3DCUBEMAP_FACE_NEGATIVE_Y = 3
974 D3DCUBEMAP_FACE_POSITIVE_Z = 4
975 D3DCUBEMAP_FACE_NEGATIVE_Z = 5
976
977 D3DCUBEMAP_FACE_FORCE_DWORD = &H7FFFFFFF
978End Enum
979
980' Lock flags
981Const D3DLOCK_READONLY = &H00000010
982Const D3DLOCK_DISCARD = &H00002000
983Const D3DLOCK_NOOVERWRITE = &H00001000
984Const D3DLOCK_NOSYSLOCK = &H00000800
985Const D3DLOCK_DONOTWAIT = &H00004000
986Const D3DLOCK_NO_DIRTY_UPDATE = &H00008000
987
988
989
990' Vertex Buffer Description
991Type D3DVERTEXBUFFER_DESC
992 Format As D3DFORMAT
993 SourceType As D3DRESOURCETYPE
994 Usage As DWord
995 Pool As D3DPOOL
996 Size As DWord
997
998 FVF As DWord
999End Type
1000
1001' Index Buffer Description
1002Type D3DINDEXBUFFER_DESC
1003 Format As D3DFORMAT
1004 SourceType As D3DRESOURCETYPE
1005 Usage As DWord
1006 Pool As D3DPOOL
1007 Size As DWord
1008End Type
1009
1010
1011' Surface Description
1012Type D3DSURFACE_DESC
1013 Format As D3DFORMAT
1014 SourceType As D3DRESOURCETYPE
1015 Usage As DWord
1016 Pool As D3DPOOL
1017 MultiSampleType As D3DMULTISAMPLE_TYPE
1018 MultiSampleQuality As DWord
1019 Width As DWord
1020 Height As DWord
1021End Type
1022
1023
1024Type D3DVOLUME_DESC
1025 Format As D3DFORMAT
1026 SourceType As D3DRESOURCETYPE
1027 Usage As DWord
1028 Pool As D3DPOOL
1029 Width As DWord
1030 Height As DWord
1031 Depth As DWord
1032End Type
1033
1034' Structure for LockRect
1035Type D3DLOCKED_RECT
1036 Pitch As Long
1037 pBits As VoidPtr
1038End Type
1039
1040'Structures for LockBox
1041Type D3DBOX
1042 Left As DWord
1043 Top As DWord
1044 Right As DWord
1045 Bottom As DWord
1046 Front As DWord
1047 Back As DWord
1048End Type
1049
1050Type D3DLOCKED_BOX
1051 RowPitch As Long
1052 SlicePitch As Long
1053 pBits As VoidPtr
1054End Type
1055
1056' Structures for LockRange
1057Type D3DRANGE
1058 Offset As DWord
1059 Size As DWord
1060End Type
1061
1062' Structures for high order primitives
1063Type D3DRECTPATCH_INFO
1064 StartVertexOffsetWidth As DWord
1065 StartVertexOffsetHeight As DWord
1066 Width As DWord
1067 Height As DWord
1068 Stride As DWord
1069 Basis As D3DBASISTYPE
1070 Degree As D3DDEGREETYPE
1071End Type
1072Type D3DTRIPATCH_INFO
1073 StartVertexOffset As DWord
1074 NumVertices As DWord
1075 Basis As D3DBASISTYPE
1076 Degree As D3DDEGREETYPE
1077End Type
1078
1079
1080' Adapter Identifier
1081Const MAX_DEVICE_IDENTIFIER_STRING = 512
1082Type D3DADAPTER_IDENTIFIER9
1083 Driver[MAX_DEVICE_IDENTIFIER_STRING-1] As Byte
1084 Description[MAX_DEVICE_IDENTIFIER_STRING-1] As Byte
1085 DeviceName[31] As Byte
1086
1087 DriverVersionLowPart As DWord
1088 DriverVersionHighPart As DWord
1089
1090 VendorId As DWord
1091 DeviceId As DWord
1092 SubSysId As DWord
1093 Revision As DWord
1094
1095 DeviceIdentifier As GUID
1096
1097 WHQLLevel As DWord
1098End Type
1099
1100' Raster Status structure returned by GetRasterStatus
1101Type D3DRASTER_STATUS
1102 InVBlank As Long
1103 ScanLine As DWord
1104End Type
1105
1106
1107Const Enum D3DDEBUGMONITORTOKENS
1108 D3DDMT_ENABLE = 0 'enable debug monitor
1109 D3DDMT_DISABLE = 1 'disable debug monitor
1110 D3DDMT_FORCE_DWORD = &H7FFFFFFF
1111End Enum
1112
1113
1114'Async feedback
1115Const Enum D3DQUERYTYPE
1116 D3DQUERYTYPE_VCACHE = 4 'D3DISSUE_END
1117 D3DQUERYTYPE_RESOURCEMANAGER = 5 'D3DISSUE_END
1118 D3DQUERYTYPE_VERTEXSTATS = 6 'D3DISSUE_END
1119 D3DQUERYTYPE_EVENT = 8 'D3DISSUE_END
1120 D3DQUERYTYPE_OCCLUSION = 9 'D3DISSUE_BEGIN, D3DISSUE_END
1121 D3DQUERYTYPE_TIMESTAMP = 10 'D3DISSUE_END
1122 D3DQUERYTYPE_TIMESTAMPDISJOINT = 11 'D3DISSUE_BEGIN, D3DISSUE_END
1123 D3DQUERYTYPE_TIMESTAMPFREQ = 12 'D3DISSUE_END
1124 D3DQUERYTYPE_PIPELINETIMINGS = 13 'D3DISSUE_BEGIN, D3DISSUE_END
1125 D3DQUERYTYPE_INTERFACETIMINGS = 14 'D3DISSUE_BEGIN, D3DISSUE_END
1126 D3DQUERYTYPE_VERTEXTIMINGS = 15 'D3DISSUE_BEGIN, D3DISSUE_END
1127 D3DQUERYTYPE_PIXELTIMINGS = 16 'D3DISSUE_BEGIN, D3DISSUE_END
1128 D3DQUERYTYPE_BANDWIDTHTIMINGS = 17 'D3DISSUE_BEGIN, D3DISSUE_END
1129 D3DQUERYTYPE_CACHEUTILIZATION = 18 'D3DISSUE_BEGIN, D3DISSUE_END
1130End Enum
1131
1132' Flags field for Issue
1133Const D3DISSUE_END = 1<<0 'Tells the runtime to issue the end of a query, changing it's state to "non-signaled".
1134Const D3DISSUE_BEGIN = 1<<1 'Tells the runtime to issue the beginng of a query.
1135
1136' Flags field for GetData
1137Const D3DGETDATA_FLUSH = 1<<0 'Tells the runtime to flush if the query is outstanding.
1138
1139
1140Type D3DRESOURCESTATS
1141'Data collected since last Present()
1142 bThrashing As Long 'indicates if thrashing
1143 ApproxBytesDownloaded As DWord 'Approximate number of bytes downloaded by resource manager
1144 NumEvicts As DWord 'number of objects evicted
1145 NumVidCreates As DWord 'number of objects created in video memory
1146 LastPri As DWord 'priority of last object evicted
1147 NumUsed As DWord 'number of objects set to the device
1148 NumUsedInVidMem As DWord 'number of objects set to the device, which are already in video memory
1149'Persistent data
1150 WorkingSet As DWord 'number of objects in video memory
1151 WorkingSetBytes As DWord 'number of bytes in video memory
1152 TotalManaged As DWord 'total number of managed objects
1153 TotalBytes As DWord 'total number of bytes of managed objects
1154End Type
1155
1156Const D3DRTYPECOUNT = 8
1157
1158Type D3DDEVINFO_RESOURCEMANAGER
1159 stats[D3DRTYPECOUNT-1] As D3DRESOURCESTATS
1160End Type
1161
1162Type D3DDEVINFO_D3DVERTEXSTATS
1163 NumRenderedTriangles As DWord 'total number of triangles that are not clipped in this frame
1164 NumExtraClippingTriangles As DWord 'Number of new triangles generated by clipping
1165End Type
1166
1167Type D3DDEVINFO_VCACHE
1168 Pattern As DWord
1169 OptMethod As DWord
1170 CacheSize As DWord
1171 MagicNumber As DWord
1172End Type
1173
1174Type D3DDEVINFO_D3D9PIPELINETIMINGS
1175 VertexProcessingTimePercent As Single
1176 PixelProcessingTimePercent As Single
1177 OtherGPUProcessingTimePercent As Single
1178 GPUIdleTimePercent As Single
1179End Type
1180
1181Type D3DDEVINFO_D3D9INTERFACETIMINGS
1182 WaitingForGPUToUseApplicationResourceTimePercent As Single
1183 WaitingForGPUToAcceptMoreCommandsTimePercent As Single
1184 WaitingForGPUToStayWithinLatencyTimePercent As Single
1185 WaitingForGPUExclusiveResourceTimePercent As Single
1186 WaitingForGPUOtherTimePercent As Single
1187End Type
1188
1189Type D3DDEVINFO_D3D9STAGETIMINGS
1190 MemoryProcessingPercent As Single
1191 ComputationProcessingPercent As Single
1192End Type
1193
1194Type D3DDEVINFO_D3D9BANDWIDTHTIMINGS
1195 MaxBandwidthUtilized As Single
1196 FrontEndUploadMemoryUtilizedPercent As Single
1197 VertexRateUtilizedPercent As Single
1198 TriangleSetupRateUtilizedPercent As Single
1199 FillRateUtilizedPercent As Single
1200End Type
1201
1202Type D3DDEVINFO_D3D9CACHEUTILIZATION
1203 TextureCacheHitRate As Single
1204 PostTransformVertexCacheHitRate As Single
1205End Type
1206
1207
1208#endif '_INC_D3D9TYPES
Note: See TracBrowser for help on using the repository browser.