1 ##########################################################################
3 # Copyright 2008-2009 VMware, Inc.
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 ##########################################################################/
29 from d3dtypes import *
31 D3DTRANSFORMCAPS = Flags(DWORD, [
32 "D3DTRANSFORMCAPS_CLIP",
35 D3DTRANSFORMCAPS = Struct("D3DTRANSFORMCAPS", [
40 D3DLIGHTINGCAPS = Struct("D3DLIGHTINGCAPS", [
43 (DWORD, "dwLightingModel"),
44 (DWORD, "dwNumLights"),
47 D3DLIGHTINGMODEL = Flags(DWORD, [
48 "D3DLIGHTINGMODEL_RGB",
49 "D3DLIGHTINGMODEL_MONO",
52 D3DLIGHTCAPS = Flags(DWORD, [
55 "D3DLIGHTCAPS_DIRECTIONAL",
56 "D3DLIGHTCAPS_PARALLELPOINT",
57 "D3DLIGHTCAPS_GLSPOT",
60 D3DPRIMCAPS = Struct("D3DPRIMCAPS", [
62 (DWORD, "dwMiscCaps"),
63 (DWORD, "dwRasterCaps"),
64 (DWORD, "dwZCmpCaps"),
65 (DWORD, "dwSrcBlendCaps"),
66 (DWORD, "dwDestBlendCaps"),
67 (DWORD, "dwAlphaCmpCaps"),
68 (DWORD, "dwShadeCaps"),
69 (DWORD, "dwTextureCaps"),
70 (DWORD, "dwTextureFilterCaps"),
71 (DWORD, "dwTextureBlendCaps"),
72 (DWORD, "dwTextureAddressCaps"),
73 (DWORD, "dwStippleWidth"),
74 (DWORD, "dwStippleHeight"),
77 D3DPMISCCAPS = Flags(DWORD, [
78 "D3DPMISCCAPS_MASKPLANES",
80 "D3DPMISCCAPS_LINEPATTERNREP",
81 "D3DPMISCCAPS_CONFORMANT",
82 "D3DPMISCCAPS_CULLNONE",
83 "D3DPMISCCAPS_CULLCW",
84 "D3DPMISCCAPS_CULLCCW",
87 D3DXD3DPRASTERCAPSXX = Flags(DWORD, [
88 "D3DPRASTERCAPS_DITHER",
89 "D3DPRASTERCAPS_ROP2",
92 "D3DPRASTERCAPS_ZTEST",
93 "D3DPRASTERCAPS_SUBPIXEL",
94 "D3DPRASTERCAPS_SUBPIXELX",
95 "D3DPRASTERCAPS_FOGVERTEX",
96 "D3DPRASTERCAPS_FOGTABLE",
97 "D3DPRASTERCAPS_STIPPLE",
98 "D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT",
99 "D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT",
100 "D3DPRASTERCAPS_ANTIALIASEDGES",
101 "D3DPRASTERCAPS_MIPMAPLODBIAS",
102 "D3DPRASTERCAPS_ZBIAS",
103 "D3DPRASTERCAPS_ZBUFFERLESSHSR",
104 "D3DPRASTERCAPS_FOGRANGE",
105 "D3DPRASTERCAPS_ANISOTROPY",
106 "D3DPRASTERCAPS_WBUFFER",
107 "D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT",
108 "D3DPRASTERCAPS_WFOG",
109 "D3DPRASTERCAPS_ZFOG",
112 D3DPCMPCAPS = Flags(DWORD, [
116 "D3DPCMPCAPS_LESSEQUAL",
117 "D3DPCMPCAPS_GREATER",
118 "D3DPCMPCAPS_NOTEQUAL",
119 "D3DPCMPCAPS_GREATEREQUAL",
120 "D3DPCMPCAPS_ALWAYS",
123 D3DPBLENDCAPS = Flags(DWORD, [
124 "D3DPBLENDCAPS_ZERO",
126 "D3DPBLENDCAPS_SRCCOLOR",
127 "D3DPBLENDCAPS_INVSRCCOLOR",
128 "D3DPBLENDCAPS_SRCALPHA",
129 "D3DPBLENDCAPS_INVSRCALPHA",
130 "D3DPBLENDCAPS_DESTALPHA",
131 "D3DPBLENDCAPS_INVDESTALPHA",
132 "D3DPBLENDCAPS_DESTCOLOR",
133 "D3DPBLENDCAPS_INVDESTCOLOR",
134 "D3DPBLENDCAPS_SRCALPHASAT",
135 "D3DPBLENDCAPS_BOTHSRCALPHA",
136 "D3DPBLENDCAPS_BOTHINVSRCALPHA",
139 D3DPSHADECAPS = Flags(DWORD, [
140 "D3DPSHADECAPS_COLORFLATMONO",
141 "D3DPSHADECAPS_COLORFLATRGB",
142 "D3DPSHADECAPS_COLORGOURAUDMONO",
143 "D3DPSHADECAPS_COLORGOURAUDRGB",
144 "D3DPSHADECAPS_COLORPHONGMONO",
145 "D3DPSHADECAPS_COLORPHONGRGB",
146 "D3DPSHADECAPS_SPECULARFLATMONO",
147 "D3DPSHADECAPS_SPECULARFLATRGB",
148 "D3DPSHADECAPS_SPECULARGOURAUDMONO",
149 "D3DPSHADECAPS_SPECULARGOURAUDRGB",
150 "D3DPSHADECAPS_SPECULARPHONGMONO",
151 "D3DPSHADECAPS_SPECULARPHONGRGB",
152 "D3DPSHADECAPS_ALPHAFLATBLEND",
153 "D3DPSHADECAPS_ALPHAFLATSTIPPLED",
154 "D3DPSHADECAPS_ALPHAGOURAUDBLEND",
155 "D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED",
156 "D3DPSHADECAPS_ALPHAPHONGBLEND",
157 "D3DPSHADECAPS_ALPHAPHONGSTIPPLED",
158 "D3DPSHADECAPS_FOGFLAT",
159 "D3DPSHADECAPS_FOGGOURAUD",
160 "D3DPSHADECAPS_FOGPHONG",
163 D3DPTEXTURECAPS = Flags(DWORD, [
164 "D3DPTEXTURECAPS_PERSPECTIVE",
165 "D3DPTEXTURECAPS_POW2",
166 "D3DPTEXTURECAPS_ALPHA",
167 "D3DPTEXTURECAPS_TRANSPARENCY",
168 "D3DPTEXTURECAPS_BORDER",
169 "D3DPTEXTURECAPS_SQUAREONLY",
170 "D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE",
171 "D3DPTEXTURECAPS_ALPHAPALETTE",
172 "D3DPTEXTURECAPS_NONPOW2CONDITIONAL",
173 "D3DPTEXTURECAPS_PROJECTED",
174 "D3DPTEXTURECAPS_CUBEMAP",
175 "D3DPTEXTURECAPS_COLORKEYBLEND",
178 D3DPTFILTERCAPS = Flags(DWORD, [
179 "D3DPTFILTERCAPS_NEAREST",
180 "D3DPTFILTERCAPS_LINEAR",
181 "D3DPTFILTERCAPS_MIPNEAREST",
182 "D3DPTFILTERCAPS_MIPLINEAR",
183 "D3DPTFILTERCAPS_LINEARMIPNEAREST",
184 "D3DPTFILTERCAPS_LINEARMIPLINEAR",
185 "D3DPTFILTERCAPS_MINFPOINT",
186 "D3DPTFILTERCAPS_MINFLINEAR",
187 "D3DPTFILTERCAPS_MINFANISOTROPIC",
188 "D3DPTFILTERCAPS_MIPFPOINT",
189 "D3DPTFILTERCAPS_MIPFLINEAR",
190 "D3DPTFILTERCAPS_MAGFPOINT",
191 "D3DPTFILTERCAPS_MAGFLINEAR",
192 "D3DPTFILTERCAPS_MAGFANISOTROPIC",
193 "D3DPTFILTERCAPS_MAGFAFLATCUBIC",
194 "D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC",
197 D3DPTBLENDCAPS = Flags(DWORD, [
198 "D3DPTBLENDCAPS_DECAL",
199 "D3DPTBLENDCAPS_MODULATE",
200 "D3DPTBLENDCAPS_DECALALPHA",
201 "D3DPTBLENDCAPS_MODULATEALPHA",
202 "D3DPTBLENDCAPS_DECALMASK",
203 "D3DPTBLENDCAPS_MODULATEMASK",
204 "D3DPTBLENDCAPS_COPY",
205 "D3DPTBLENDCAPS_ADD",
208 D3DPTADDRESSCAPS = Flags(DWORD, [
209 "D3DPTADDRESSCAPS_WRAP",
210 "D3DPTADDRESSCAPS_MIRROR",
211 "D3DPTADDRESSCAPS_CLAMP",
212 "D3DPTADDRESSCAPS_BORDER",
213 "D3DPTADDRESSCAPS_INDEPENDENTUV",
216 D3DSTENCILCAPS = Flags(DWORD, [
217 "D3DSTENCILCAPS_KEEP",
218 "D3DSTENCILCAPS_ZERO",
219 "D3DSTENCILCAPS_REPLACE",
220 "D3DSTENCILCAPS_INCRSAT",
221 "D3DSTENCILCAPS_DECRSAT",
222 "D3DSTENCILCAPS_INVERT",
223 "D3DSTENCILCAPS_INCR",
224 "D3DSTENCILCAPS_DECR",
227 D3DTEXOPCAPS = Flags(DWORD, [
228 "D3DTEXOPCAPS_DISABLE",
229 "D3DTEXOPCAPS_SELECTARG1",
230 "D3DTEXOPCAPS_SELECTARG2",
231 "D3DTEXOPCAPS_MODULATE",
232 "D3DTEXOPCAPS_MODULATE2X",
233 "D3DTEXOPCAPS_MODULATE4X",
235 "D3DTEXOPCAPS_ADDSIGNED",
236 "D3DTEXOPCAPS_ADDSIGNED2X",
237 "D3DTEXOPCAPS_SUBTRACT",
238 "D3DTEXOPCAPS_ADDSMOOTH",
239 "D3DTEXOPCAPS_BLENDDIFFUSEALPHA",
240 "D3DTEXOPCAPS_BLENDTEXTUREALPHA",
241 "D3DTEXOPCAPS_BLENDFACTORALPHA",
242 "D3DTEXOPCAPS_BLENDTEXTUREALPHAPM",
243 "D3DTEXOPCAPS_BLENDCURRENTALPHA",
244 "D3DTEXOPCAPS_PREMODULATE",
245 "D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR",
246 "D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA",
247 "D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR",
248 "D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA",
249 "D3DTEXOPCAPS_BUMPENVMAP",
250 "D3DTEXOPCAPS_BUMPENVMAPLUMINANCE",
251 "D3DTEXOPCAPS_DOTPRODUCT3",
254 D3DFVFCAPS = Flags(DWORD, [
255 "D3DFVFCAPS_TEXCOORDCOUNTMASK",
256 "D3DFVFCAPS_DONOTSTRIPELEMENTS",
259 D3DDD = Flags(DWORD, [
262 "D3DDD_TRANSFORMCAPS",
263 "D3DDD_LIGHTINGCAPS",
267 "D3DDD_DEVICERENDERBITDEPTH",
268 "D3DDD_DEVICEZBUFFERBITDEPTH",
269 "D3DDD_MAXBUFFERSIZE",
270 "D3DDD_MAXVERTEXCOUNT",
273 D3DDEVCAPS = Flags(DWORD, [
274 "D3DDEVCAPS_FLOATTLVERTEX",
275 "D3DDEVCAPS_SORTINCREASINGZ",
276 "D3DDEVCAPS_SORTDECREASINGZ",
277 "D3DDEVCAPS_SORTEXACT",
278 "D3DDEVCAPS_EXECUTESYSTEMMEMORY",
279 "D3DDEVCAPS_EXECUTEVIDEOMEMORY",
280 "D3DDEVCAPS_TLVERTEXSYSTEMMEMORY",
281 "D3DDEVCAPS_TLVERTEXVIDEOMEMORY",
282 "D3DDEVCAPS_TEXTURESYSTEMMEMORY",
283 "D3DDEVCAPS_TEXTUREVIDEOMEMORY",
284 "D3DDEVCAPS_DRAWPRIMTLVERTEX",
285 "D3DDEVCAPS_CANRENDERAFTERFLIP",
286 "D3DDEVCAPS_TEXTURENONLOCALVIDMEM",
287 "D3DDEVCAPS_DRAWPRIMITIVES2",
288 "D3DDEVCAPS_SEPARATETEXTUREMEMORIES",
289 "D3DDEVCAPS_DRAWPRIMITIVES2EX",
290 "D3DDEVCAPS_HWTRANSFORMANDLIGHT",
291 "D3DDEVCAPS_CANBLTSYSTONONLOCAL",
292 "D3DDEVCAPS_HWRASTERIZATION",
295 D3DVTXPCAPS = Flags(DWORD, [
296 "D3DVTXPCAPS_TEXGEN",
297 "D3DVTXPCAPS_MATERIALSOURCE7",
298 "D3DVTXPCAPS_VERTEXFOG",
299 "D3DVTXPCAPS_DIRECTIONALLIGHTS",
300 "D3DVTXPCAPS_POSITIONALLIGHTS",
301 "D3DVTXPCAPS_LOCALVIEWER",
304 D3DFDS = Flags(DWORD, [
313 "D3DFDS_ALPHACMPCAPS",
314 "D3DFDS_SRCBLENDCAPS",
315 "D3DFDS_DSTBLENDCAPS",
317 "D3DFDS_TEXTURECAPS",
318 "D3DFDS_TEXTUREFILTERCAPS",
319 "D3DFDS_TEXTUREBLENDCAPS",
320 "D3DFDS_TEXTUREADDRESSCAPS",
323 D3DFINDDEVICESEARCH = Struct("D3DFINDDEVICESEARCH", [
327 (D3DCOLORMODEL, "dcmColorModel"),
330 (D3DPRIMCAPS, "dpcPrimCaps"),
332 LPD3DFINDDEVICESEARCH = Pointer(D3DFINDDEVICESEARCH)
334 D3DEXECUTEBUFFERDESC = Struct("D3DEXECUTEBUFFERDESC", [
338 (DWORD, "dwBufferSize"),
341 LPD3DEXECUTEBUFFERDESC = Pointer(D3DEXECUTEBUFFERDESC)
343 D3DDEB = Flags(DWORD, [
349 D3DDEBCAPS = Flags(DWORD, [
350 "D3DDEBCAPS_SYSTEMMEMORY",
351 "D3DDEBCAPS_VIDEOMEMORY",
355 D3DDEVINFO_TEXTUREMANAGER = Struct("D3DDEVINFO_TEXTUREMANAGER", [
356 (BOOL, "bThrashing"),
357 (DWORD, "dwApproxBytesDownloaded"),
358 (DWORD, "dwNumEvicts"),
359 (DWORD, "dwNumVidCreates"),
360 (DWORD, "dwNumTexturesUsed"),
361 (DWORD, "dwNumUsedTexInVid"),
362 (DWORD, "dwWorkingSet"),
363 (DWORD, "dwWorkingSetBytes"),
364 (DWORD, "dwTotalManaged"),
365 (DWORD, "dwTotalBytes"),
366 (DWORD, "dwLastPri"),
369 D3DDEVINFO_TEXTURING = Struct("D3DDEVINFO_TEXTURING", [
370 (DWORD, "dwNumLoads"),
371 (DWORD, "dwApproxBytesLoaded"),
372 (DWORD, "dwNumPreLoads"),
374 (DWORD, "dwNumCreates"),
375 (DWORD, "dwNumDestroys"),
376 (DWORD, "dwNumSetPriorities"),
377 (DWORD, "dwNumSetLODs"),
378 (DWORD, "dwNumLocks"),
379 (DWORD, "dwNumGetDCs"),
382 D3DDEVICEDESC = Struct("D3DDEVICEDESC", [
385 (D3DCOLORMODEL, "dcmColorModel"),
386 (DWORD, "dwDevCaps"),
387 (D3DTRANSFORMCAPS, "dtcTransformCaps"),
389 (D3DLIGHTINGCAPS, "dlcLightingCaps"),
390 (D3DPRIMCAPS, "dpcLineCaps"),
391 (D3DPRIMCAPS, "dpcTriCaps"),
392 (DWORD, "dwDeviceRenderBitDepth"),
393 (DWORD, "dwDeviceZBufferBitDepth"),
394 (DWORD, "dwMaxBufferSize"),
395 (DWORD, "dwMaxVertexCount"),
396 (DWORD, "dwMinTextureWidth"),
397 (DWORD, "dwMinTextureHeight"),
398 (DWORD, "dwMaxTextureWidth"),
399 (DWORD, "dwMaxTextureHeight"),
400 (DWORD, "dwMinStippleWidth"),
401 (DWORD, "dwMaxStippleWidth"),
402 (DWORD, "dwMinStippleHeight"),
403 (DWORD, "dwMaxStippleHeight"),
404 (DWORD, "dwMaxTextureRepeat"),
405 (DWORD, "dwMaxTextureAspectRatio"),
406 (DWORD, "dwMaxAnisotropy"),
407 (D3DVALUE, "dvGuardBandLeft"),
408 (D3DVALUE, "dvGuardBandTop"),
409 (D3DVALUE, "dvGuardBandRight"),
410 (D3DVALUE, "dvGuardBandBottom"),
411 (D3DVALUE, "dvExtentsAdjust"),
412 (DWORD, "dwStencilCaps"),
413 (DWORD, "dwFVFCaps"),
414 (DWORD, "dwTextureOpCaps"),
415 (WORD, "wMaxTextureBlendStages"),
416 (WORD, "wMaxSimultaneousTextures"),
418 LPD3DDEVICEDESC = Pointer(D3DDEVICEDESC)
420 D3DDEVICEDESC7 = Struct("D3DDEVICEDESC7", [
421 (DWORD, "dwDevCaps"),
422 (D3DPRIMCAPS, "dpcLineCaps"),
423 (D3DPRIMCAPS, "dpcTriCaps"),
424 (DWORD, "dwDeviceRenderBitDepth"),
425 (DWORD, "dwDeviceZBufferBitDepth"),
426 (DWORD, "dwMinTextureWidth"),
427 (DWORD, "dwMinTextureHeight"),
428 (DWORD, "dwMaxTextureWidth"),
429 (DWORD, "dwMaxTextureHeight"),
430 (DWORD, "dwMaxTextureRepeat"),
431 (DWORD, "dwMaxTextureAspectRatio"),
432 (DWORD, "dwMaxAnisotropy"),
433 (D3DVALUE, "dvGuardBandLeft"),
434 (D3DVALUE, "dvGuardBandTop"),
435 (D3DVALUE, "dvGuardBandRight"),
436 (D3DVALUE, "dvGuardBandBottom"),
437 (D3DVALUE, "dvExtentsAdjust"),
438 (DWORD, "dwStencilCaps"),
439 (DWORD, "dwFVFCaps"),
440 (DWORD, "dwTextureOpCaps"),
441 (WORD, "wMaxTextureBlendStages"),
442 (WORD, "wMaxSimultaneousTextures"),
443 (DWORD, "dwMaxActiveLights"),
444 (D3DVALUE, "dvMaxVertexW"),
445 (GUID, "deviceGUID"),
446 (WORD, "wMaxUserClipPlanes"),
447 (WORD, "wMaxVertexBlendMatrices"),
448 (DWORD, "dwVertexProcessingCaps"),
449 (DWORD, "dwReserved1"),
450 (DWORD, "dwReserved2"),
451 (DWORD, "dwReserved3"),
452 (DWORD, "dwReserved4"),
454 LPD3DDEVICEDESC7 = Pointer(D3DDEVICEDESC7)
456 D3DFINDDEVICERESULT = Struct("D3DFINDDEVICERESULT", [
459 (D3DDEVICEDESC, "ddHwDesc"),
460 (D3DDEVICEDESC, "ddSwDesc"),
462 LPD3DFINDDEVICERESULT = Pointer(D3DFINDDEVICERESULT)
464 LPD3DENUMDEVICESCALLBACK = FunctionPointer(HRESULT, "LPD3DENUMDEVICESCALLBACK", [(Pointer(GUID), "lpGuid"), (LPSTR, "lpDeviceDescription"), (LPSTR, "lpDeviceName"), LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID])
465 LPD3DENUMDEVICESCALLBACK7 = FunctionPointer(HRESULT, "LPD3DENUMDEVICESCALLBACK7", [(LPSTR, "lpDeviceDescription"), (LPSTR, "lpDeviceName"), LPD3DDEVICEDESC7, LPVOID])