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 d3d8types import *
31 D3DCAPS = Flags(DWORD, [
32 "D3DCAPS_READ_SCANLINE",
35 D3DCAPS2 = Flags(DWORD, [
36 "D3DCAPS2_NO2DDURING3DSCENE",
37 "D3DCAPS2_FULLSCREENGAMMA",
38 "D3DCAPS2_CANRENDERWINDOWED",
39 "D3DCAPS2_CANCALIBRATEGAMMA",
41 "D3DCAPS2_CANMANAGERESOURCE",
42 "D3DCAPS2_DYNAMICTEXTURES",
45 D3DCAPS3 = Flags(DWORD, [
47 "D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD",
50 D3DCURSORCAPS = Flags(DWORD, [
51 "D3DCURSORCAPS_COLOR",
52 "D3DCURSORCAPS_LOWRES",
55 D3DDEVCAPS = Flags(DWORD, [
56 "D3DDEVCAPS_EXECUTESYSTEMMEMORY",
57 "D3DDEVCAPS_EXECUTEVIDEOMEMORY",
58 "D3DDEVCAPS_TLVERTEXSYSTEMMEMORY",
59 "D3DDEVCAPS_TLVERTEXVIDEOMEMORY",
60 "D3DDEVCAPS_TEXTURESYSTEMMEMORY",
61 "D3DDEVCAPS_TEXTUREVIDEOMEMORY",
62 "D3DDEVCAPS_DRAWPRIMTLVERTEX",
63 "D3DDEVCAPS_CANRENDERAFTERFLIP",
64 "D3DDEVCAPS_TEXTURENONLOCALVIDMEM",
65 "D3DDEVCAPS_DRAWPRIMITIVES2",
66 "D3DDEVCAPS_SEPARATETEXTUREMEMORIES",
67 "D3DDEVCAPS_DRAWPRIMITIVES2EX",
68 "D3DDEVCAPS_HWTRANSFORMANDLIGHT",
69 "D3DDEVCAPS_CANBLTSYSTONONLOCAL",
70 "D3DDEVCAPS_HWRASTERIZATION",
71 "D3DDEVCAPS_PUREDEVICE",
72 "D3DDEVCAPS_QUINTICRTPATCHES",
73 "D3DDEVCAPS_RTPATCHES",
74 "D3DDEVCAPS_RTPATCHHANDLEZERO",
75 "D3DDEVCAPS_NPATCHES",
78 D3DPMISCCAPS = Flags(DWORD, [
80 "D3DPMISCCAPS_LINEPATTERNREP",
81 "D3DPMISCCAPS_CULLNONE",
82 "D3DPMISCCAPS_CULLCW",
83 "D3DPMISCCAPS_CULLCCW",
84 "D3DPMISCCAPS_COLORWRITEENABLE",
85 "D3DPMISCCAPS_CLIPPLANESCALEDPOINTS",
86 "D3DPMISCCAPS_CLIPTLVERTS",
87 "D3DPMISCCAPS_TSSARGTEMP",
88 "D3DPMISCCAPS_BLENDOP",
89 "D3DPMISCCAPS_NULLREFERENCE",
92 D3DLINECAPS = Flags(DWORD, [
93 "D3DLINECAPS_TEXTURE",
96 "D3DLINECAPS_ALPHACMP",
100 D3DPRASTERCAPS = Flags(DWORD, [
101 "D3DPRASTERCAPS_DITHER",
102 "D3DPRASTERCAPS_PAT",
103 "D3DPRASTERCAPS_ZTEST",
104 "D3DPRASTERCAPS_FOGVERTEX",
105 "D3DPRASTERCAPS_FOGTABLE",
106 "D3DPRASTERCAPS_ANTIALIASEDGES",
107 "D3DPRASTERCAPS_MIPMAPLODBIAS",
108 "D3DPRASTERCAPS_ZBIAS",
109 "D3DPRASTERCAPS_ZBUFFERLESSHSR",
110 "D3DPRASTERCAPS_FOGRANGE",
111 "D3DPRASTERCAPS_ANISOTROPY",
112 "D3DPRASTERCAPS_WBUFFER",
113 "D3DPRASTERCAPS_WFOG",
114 "D3DPRASTERCAPS_ZFOG",
115 "D3DPRASTERCAPS_COLORPERSPECTIVE",
116 "D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE",
119 D3DPCMPCAPS = Flags(DWORD, [
123 "D3DPCMPCAPS_LESSEQUAL",
124 "D3DPCMPCAPS_GREATER",
125 "D3DPCMPCAPS_NOTEQUAL",
126 "D3DPCMPCAPS_GREATEREQUAL",
127 "D3DPCMPCAPS_ALWAYS",
130 D3DPBLENDCAPS = Flags(DWORD, [
131 "D3DPBLENDCAPS_ZERO",
133 "D3DPBLENDCAPS_SRCCOLOR",
134 "D3DPBLENDCAPS_INVSRCCOLOR",
135 "D3DPBLENDCAPS_SRCALPHA",
136 "D3DPBLENDCAPS_INVSRCALPHA",
137 "D3DPBLENDCAPS_DESTALPHA",
138 "D3DPBLENDCAPS_INVDESTALPHA",
139 "D3DPBLENDCAPS_DESTCOLOR",
140 "D3DPBLENDCAPS_INVDESTCOLOR",
141 "D3DPBLENDCAPS_SRCALPHASAT",
142 "D3DPBLENDCAPS_BOTHSRCALPHA",
143 "D3DPBLENDCAPS_BOTHINVSRCALPHA",
146 D3DPSHADECAPS = Flags(DWORD, [
147 "D3DPSHADECAPS_COLORGOURAUDRGB",
148 "D3DPSHADECAPS_SPECULARGOURAUDRGB",
149 "D3DPSHADECAPS_ALPHAGOURAUDBLEND",
150 "D3DPSHADECAPS_FOGGOURAUD",
153 D3DPTEXTURECAPS = Flags(DWORD, [
154 "D3DPTEXTURECAPS_PERSPECTIVE",
155 "D3DPTEXTURECAPS_POW2",
156 "D3DPTEXTURECAPS_ALPHA",
157 "D3DPTEXTURECAPS_SQUAREONLY",
158 "D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE",
159 "D3DPTEXTURECAPS_ALPHAPALETTE",
160 "D3DPTEXTURECAPS_NONPOW2CONDITIONAL",
161 "D3DPTEXTURECAPS_PROJECTED",
162 "D3DPTEXTURECAPS_CUBEMAP",
163 "D3DPTEXTURECAPS_VOLUMEMAP",
164 "D3DPTEXTURECAPS_MIPMAP",
165 "D3DPTEXTURECAPS_MIPVOLUMEMAP",
166 "D3DPTEXTURECAPS_MIPCUBEMAP",
167 "D3DPTEXTURECAPS_CUBEMAP_POW2",
168 "D3DPTEXTURECAPS_VOLUMEMAP_POW2",
171 D3DPTFILTERCAPS = Flags(DWORD, [
172 "D3DPTFILTERCAPS_MINFPOINT",
173 "D3DPTFILTERCAPS_MINFLINEAR",
174 "D3DPTFILTERCAPS_MINFANISOTROPIC",
175 "D3DPTFILTERCAPS_MIPFPOINT",
176 "D3DPTFILTERCAPS_MIPFLINEAR",
177 "D3DPTFILTERCAPS_MAGFPOINT",
178 "D3DPTFILTERCAPS_MAGFLINEAR",
179 "D3DPTFILTERCAPS_MAGFANISOTROPIC",
180 "D3DPTFILTERCAPS_MAGFAFLATCUBIC",
181 "D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC",
184 D3DPTADDRESSCAPS = Flags(DWORD, [
185 "D3DPTADDRESSCAPS_WRAP",
186 "D3DPTADDRESSCAPS_MIRROR",
187 "D3DPTADDRESSCAPS_CLAMP",
188 "D3DPTADDRESSCAPS_BORDER",
189 "D3DPTADDRESSCAPS_INDEPENDENTUV",
190 "D3DPTADDRESSCAPS_MIRRORONCE",
193 D3DSTENCILCAPS = Flags(DWORD, [
194 "D3DSTENCILCAPS_KEEP",
195 "D3DSTENCILCAPS_ZERO",
196 "D3DSTENCILCAPS_REPLACE",
197 "D3DSTENCILCAPS_INCRSAT",
198 "D3DSTENCILCAPS_DECRSAT",
199 "D3DSTENCILCAPS_INVERT",
200 "D3DSTENCILCAPS_INCR",
201 "D3DSTENCILCAPS_DECR",
204 D3DTEXOPCAPS = Flags(DWORD, [
205 "D3DTEXOPCAPS_DISABLE",
206 "D3DTEXOPCAPS_SELECTARG1",
207 "D3DTEXOPCAPS_SELECTARG2",
208 "D3DTEXOPCAPS_MODULATE",
209 "D3DTEXOPCAPS_MODULATE2X",
210 "D3DTEXOPCAPS_MODULATE4X",
212 "D3DTEXOPCAPS_ADDSIGNED",
213 "D3DTEXOPCAPS_ADDSIGNED2X",
214 "D3DTEXOPCAPS_SUBTRACT",
215 "D3DTEXOPCAPS_ADDSMOOTH",
216 "D3DTEXOPCAPS_BLENDDIFFUSEALPHA",
217 "D3DTEXOPCAPS_BLENDTEXTUREALPHA",
218 "D3DTEXOPCAPS_BLENDFACTORALPHA",
219 "D3DTEXOPCAPS_BLENDTEXTUREALPHAPM",
220 "D3DTEXOPCAPS_BLENDCURRENTALPHA",
221 "D3DTEXOPCAPS_PREMODULATE",
222 "D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR",
223 "D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA",
224 "D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR",
225 "D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA",
226 "D3DTEXOPCAPS_BUMPENVMAP",
227 "D3DTEXOPCAPS_BUMPENVMAPLUMINANCE",
228 "D3DTEXOPCAPS_DOTPRODUCT3",
229 "D3DTEXOPCAPS_MULTIPLYADD",
233 D3DFVFCAPS = Flags(DWORD, [
234 "D3DFVFCAPS_TEXCOORDCOUNTMASK",
235 "D3DFVFCAPS_DONOTSTRIPELEMENTS",
239 D3DVTXPCAPS = Flags(DWORD, [
240 "D3DVTXPCAPS_TEXGEN",
241 "D3DVTXPCAPS_MATERIALSOURCE7",
242 "D3DVTXPCAPS_DIRECTIONALLIGHTS",
243 "D3DVTXPCAPS_POSITIONALLIGHTS",
244 "D3DVTXPCAPS_LOCALVIEWER",
245 "D3DVTXPCAPS_TWEENING",
246 "D3DVTXPCAPS_NO_VSDT_UBYTE4",
249 #D3DPS_VERSION = Enum("DWORD", [
250 # "D3DPS_VERSION(0,0)",
251 # "D3DPS_VERSION(1,0)",
252 # "D3DPS_VERSION(1,1)",
253 # "D3DPS_VERSION(1,2)",
254 # "D3DPS_VERSION(1,3)",
255 # "D3DPS_VERSION(1,4)",
256 # "D3DPS_VERSION(2,0)",
257 # "D3DPS_VERSION(3,0)",
259 D3DPS_VERSION = DWORD
261 #D3DVS_VERSION = Enum("DWORD", [
262 # "D3DVS_VERSION(0,0)",
263 # "D3DVS_VERSION(1,0)",
264 # "D3DVS_VERSION(1,1)",
265 # "D3DVS_VERSION(2,0)",
266 # "D3DVS_VERSION(3,0)",
268 D3DVS_VERSION = DWORD
270 D3DCAPS8 = Struct("D3DCAPS8", [
271 (D3DDEVTYPE, "DeviceType"),
272 (UINT, "AdapterOrdinal"),
276 (D3DPRESENT_INTERVAL, "PresentationIntervals"),
277 (D3DCURSORCAPS, "CursorCaps"),
278 (D3DDEVCAPS, "DevCaps"),
279 (D3DPMISCCAPS, "PrimitiveMiscCaps"),
280 (D3DPRASTERCAPS, "RasterCaps"),
281 (D3DPCMPCAPS, "ZCmpCaps"),
282 (D3DPBLENDCAPS, "SrcBlendCaps"),
283 (D3DPBLENDCAPS, "DestBlendCaps"),
284 (D3DPCMPCAPS, "AlphaCmpCaps"),
285 (D3DPSHADECAPS, "ShadeCaps"),
286 (D3DPTEXTURECAPS, "TextureCaps"),
287 (D3DPTFILTERCAPS, "TextureFilterCaps"),
288 (D3DPTFILTERCAPS, "CubeTextureFilterCaps"),
289 (D3DPTFILTERCAPS, "VolumeTextureFilterCaps"),
290 (D3DPTADDRESSCAPS, "TextureAddressCaps"),
291 (D3DPTADDRESSCAPS, "VolumeTextureAddressCaps"),
292 (D3DLINECAPS, "LineCaps"),
293 (DWORD, "MaxTextureWidth"),
294 (DWORD, "MaxTextureHeight"),
295 (DWORD, "MaxVolumeExtent"),
296 (DWORD, "MaxTextureRepeat"),
297 (DWORD, "MaxTextureAspectRatio"),
298 (DWORD, "MaxAnisotropy"),
299 (Float, "MaxVertexW"),
300 (Float, "GuardBandLeft"),
301 (Float, "GuardBandTop"),
302 (Float, "GuardBandRight"),
303 (Float, "GuardBandBottom"),
304 (Float, "ExtentsAdjust"),
305 (D3DSTENCILCAPS, "StencilCaps"),
306 (D3DFVFCAPS, "FVFCaps"),
307 (D3DTEXOPCAPS, "TextureOpCaps"),
308 (DWORD, "MaxTextureBlendStages"),
309 (DWORD, "MaxSimultaneousTextures"),
310 (D3DVTXPCAPS, "VertexProcessingCaps"),
311 (DWORD, "MaxActiveLights"),
312 (DWORD, "MaxUserClipPlanes"),
313 (DWORD, "MaxVertexBlendMatrices"),
314 (DWORD, "MaxVertexBlendMatrixIndex"),
315 (Float, "MaxPointSize"),
316 (DWORD, "MaxPrimitiveCount"),
317 (DWORD, "MaxVertexIndex"),
318 (DWORD, "MaxStreams"),
319 (DWORD, "MaxStreamStride"),
320 (D3DVS_VERSION, "VertexShaderVersion"),
321 (DWORD, "MaxVertexShaderConst"),
322 (D3DPS_VERSION, "PixelShaderVersion"),
323 (Float, "MaxPixelShaderValue"),