source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/d3dhal.h@ 1166

Last change on this file since 1166 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 23.4 KB
Line 
1/*
2 * Direct3D driver interface
3 * (DirectX 7 version)
4 *
5 * Copyright (C) 2001 Ove Kaaven
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _D3DHAL_H_
23#define _D3DHAL_H_
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <ddraw.h>
30#include <d3dtypes.h>
31#include <d3dcaps.h>
32#include <d3d.h>
33
34#if (DIRECT3D_VERSION >= 0x0900)
35#include <d3d9.h>
36#endif
37
38#ifndef DDRAWI_DIRECTDRAW_DEFINED
39typedef struct _DDRAWI_DIRECTDRAW_GBL FAR *LPDDRAWI_DIRECTDRAW_GBL;
40typedef struct _DDRAWI_DIRECTDRAW_LCL FAR *LPDDRAWI_DIRECTDRAW_LCL;
41#define DDRAWI_DIRECTDRAW_DEFINED
42#endif
43
44#ifndef DDRAWI_DDRAWSURFACE_DEFINED
45typedef struct _DDRAWI_DDRAWSURFACE_LCL FAR *LPDDRAWI_DDRAWSURFACE_LCL;
46#define DDRAWI_DDRAWSURFACE_DEFINED
47#endif
48
49#define D3DERR_COMMAND_UNPARSED 0x88760BB8;
50
51/*****************************************************************************
52 * device info structures
53 */
54typedef struct _D3DDeviceDesc_V1 {
55 DWORD dwSize;
56 DWORD dwFlags;
57 D3DCOLORMODEL dcmColorModel;
58 DWORD dwDevCaps;
59 D3DTRANSFORMCAPS dtcTransformCaps;
60 BOOL bClipping;
61 D3DLIGHTINGCAPS dlcLightingCaps;
62 D3DPRIMCAPS dpcLineCaps;
63 D3DPRIMCAPS dpcTriCaps;
64 DWORD dwDeviceRenderBitDepth;
65 DWORD dwDeviceZBufferBitDepth;
66 DWORD dwMaxBufferSize;
67 DWORD dwMaxVertexCount;
68} D3DDEVICEDESC_V1,*LPD3DDEVICEDESC_V1;
69
70/* this is to allow keeping the bulk of our OpenGL code out of x11drv */
71#define D3DDD_WINE_OPENGL_DEVICE 0x00008000
72
73typedef struct _D3DHAL_GLOBALDRIVERDATA {
74 DWORD dwSize;
75 D3DDEVICEDESC_V1 hwCaps;
76 DWORD dwNumVertices;
77 DWORD dwNumClipVertices;
78 DWORD dwNumTextureFormats;
79 LPDDSURFACEDESC lpTextureFormats;
80} D3DHAL_GLOBALDRIVERDATA;
81
82#ifndef D3DHAL_GLOBALDRIVERDATA_DEFINED
83typedef D3DHAL_GLOBALDRIVERDATA *LPD3DHAL_GLOBALDRIVERDATA;
84#define D3DHAL_GLOBALDRIVERDATA_DEFINED
85#endif
86
87typedef struct _D3DHAL_D3DEXTENDEDCAPS {
88 DWORD dwSize;
89 /* DirectX 5 */
90 DWORD dwMinTextureWidth, dwMaxTextureWidth;
91 DWORD dwMinTextureHeight, dwMaxTextureHeight;
92 DWORD dwMinStippleWidth, dwMaxStippleWidth;
93 DWORD dwMinStippleHeight, dwMaxStippleHeight;
94 /* DirectX 6 */
95 DWORD dwMaxTextureRepeat;
96 DWORD dwMaxTextureAspectRatio;
97 DWORD dwMaxAnisotropy;
98 D3DVALUE dvGuardBandLeft;
99 D3DVALUE dvGuardBandTop;
100 D3DVALUE dvGuardBandRight;
101 D3DVALUE dvGuardBandBottom;
102 D3DVALUE dvExtentsAdjust;
103 DWORD dwStencilCaps;
104 DWORD dwFVFCaps;
105 DWORD dwTextureOpCaps;
106 WORD wMaxTextureBlendStages;
107 WORD wMaxSimultaneousTextures;
108 /* DirectX 7 */
109 DWORD dwMaxActiveLights;
110 D3DVALUE dvMaxVertexW;
111 WORD wMaxUserClipPlanes;
112 WORD wMaxVertexBlendMatrices;
113 DWORD dwVertexProcessingCaps;
114 DWORD dwReserved1;
115 DWORD dwReserved2;
116 DWORD dwReserved3;
117 DWORD dwReserved4;
118} D3DHAL_D3DEXTENDEDCAPS,*LPD3DHAL_D3DEXTENDEDCAPS;
119
120/*****************************************************************************
121 * d3d->driver callbacks
122 */
123typedef struct _D3DHAL_CONTEXTCREATEDATA *LPD3DHAL_CONTEXTCREATEDATA;
124typedef struct _D3DHAL_CONTEXTDESTROYDATA *LPD3DHAL_CONTEXTDESTROYDATA;
125typedef struct _D3DHAL_CONTEXTDESTROYALLDATA *LPD3DHAL_CONTEXTDESTROYALLDATA;
126typedef struct _D3DHAL_SCENECAPTUREDATA *LPD3DHAL_SCENECAPTUREDATA;
127typedef struct _D3DHAL_RENDERSTATEDATA *LPD3DHAL_RENDERSTATEDATA;
128typedef struct _D3DHAL_RENDERPRIMITIVEDATA *LPD3DHAL_RENDERPRIMITIVEDATA;
129typedef struct _D3DHAL_TEXTURECREATEDATA *LPD3DHAL_TEXTURECREATEDATA;
130typedef struct _D3DHAL_TEXTUREDESTROYDATA *LPD3DHAL_TEXTUREDESTROYDATA;
131typedef struct _D3DHAL_TEXTURESWAPDATA *LPD3DHAL_TEXTURESWAPDATA;
132typedef struct _D3DHAL_TEXTUREGETSURFDATA *LPD3DHAL_TEXTUREGETSURFDATA;
133typedef struct _D3DHAL_GETSTATEDATA *LPD3DHAL_GETSTATEDATA;
134
135typedef DWORD (PASCAL *LPD3DHAL_CONTEXTCREATECB) (LPD3DHAL_CONTEXTCREATEDATA);
136typedef DWORD (PASCAL *LPD3DHAL_CONTEXTDESTROYCB) (LPD3DHAL_CONTEXTDESTROYDATA);
137typedef DWORD (PASCAL *LPD3DHAL_CONTEXTDESTROYALLCB)(LPD3DHAL_CONTEXTDESTROYALLDATA);
138typedef DWORD (PASCAL *LPD3DHAL_SCENECAPTURECB) (LPD3DHAL_SCENECAPTUREDATA);
139typedef DWORD (PASCAL *LPD3DHAL_RENDERSTATECB) (LPD3DHAL_RENDERSTATEDATA);
140typedef DWORD (PASCAL *LPD3DHAL_RENDERPRIMITIVECB) (LPD3DHAL_RENDERPRIMITIVEDATA);
141typedef DWORD (PASCAL *LPD3DHAL_TEXTURECREATECB) (LPD3DHAL_TEXTURECREATEDATA);
142typedef DWORD (PASCAL *LPD3DHAL_TEXTUREDESTROYCB) (LPD3DHAL_TEXTUREDESTROYDATA);
143typedef DWORD (PASCAL *LPD3DHAL_TEXTURESWAPCB) (LPD3DHAL_TEXTURESWAPDATA);
144typedef DWORD (PASCAL *LPD3DHAL_TEXTUREGETSURFCB) (LPD3DHAL_TEXTUREGETSURFDATA);
145typedef DWORD (PASCAL *LPD3DHAL_GETSTATECB) (LPD3DHAL_GETSTATEDATA);
146
147typedef struct _D3DHAL_CALLBACKS {
148 DWORD dwSize;
149 LPD3DHAL_CONTEXTCREATECB ContextCreate;
150 LPD3DHAL_CONTEXTDESTROYCB ContextDestroy;
151 LPD3DHAL_CONTEXTDESTROYALLCB ContextDestroyAll;
152 LPD3DHAL_SCENECAPTURECB SceneCapture;
153 LPVOID lpReserved10;
154 LPVOID lpReserved11;
155 LPD3DHAL_RENDERSTATECB RenderState;
156 LPD3DHAL_RENDERPRIMITIVECB RenderPrimitive;
157 DWORD dwReserved;
158 LPD3DHAL_TEXTURECREATECB TextureCreate;
159 LPD3DHAL_TEXTUREDESTROYCB TextureDestroy;
160 LPD3DHAL_TEXTURESWAPCB TextureSwap;
161 LPD3DHAL_TEXTUREGETSURFCB TextureGetSurf;
162 /* now why did MS create CALLBACKS2 and CALLBACKS3 structures if
163 * all these reserved fields were available? we may never know */
164 LPVOID lpReserved12;
165 LPVOID lpReserved13;
166 LPVOID lpReserved14;
167 LPVOID lpReserved15;
168 LPVOID lpReserved16;
169 LPVOID lpReserved17;
170 LPVOID lpReserved18;
171 LPVOID lpReserved19;
172 LPVOID lpReserved20;
173 LPVOID lpReserved21;
174 LPD3DHAL_GETSTATECB GetState;
175 DWORD dwReserved0;
176 DWORD dwReserved1;
177 DWORD dwReserved2;
178 DWORD dwReserved3;
179 DWORD dwReserved4;
180 DWORD dwReserved5;
181 DWORD dwReserved6;
182 DWORD dwReserved7;
183 DWORD dwReserved8;
184 DWORD dwReserved9;
185} D3DHAL_CALLBACKS;
186
187#ifndef D3DHAL_CALLBACKS_DEFINED
188typedef D3DHAL_CALLBACKS *LPD3DHAL_CALLBACKS;
189#define D3DHAL_CALLBACKS_DEFINED
190#endif
191
192typedef struct _D3DHAL_SETRENDERTARGETDATA *LPD3DHAL_SETRENDERTARGETDATA;
193typedef struct _D3DHAL_CLEARDATA *LPD3DHAL_CLEARDATA;
194typedef struct _D3DHAL_DRAWONEPRIMITIVEDATA *LPD3DHAL_DRAWONEPRIMITIVEDATA;
195typedef struct _D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA *LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA;
196typedef struct _D3DHAL_DRAWPRIMITIVESDATA *LPD3DHAL_DRAWPRIMITIVESDATA;
197
198typedef DWORD (PASCAL *LPD3DHAL_SETRENDERTARGETCB) (LPD3DHAL_SETRENDERTARGETDATA);
199typedef DWORD (PASCAL *LPD3DHAL_CLEARCB) (LPD3DHAL_CLEARDATA);
200typedef DWORD (PASCAL *LPD3DHAL_DRAWONEPRIMITIVECB) (LPD3DHAL_DRAWONEPRIMITIVEDATA);
201typedef DWORD (PASCAL *LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB)(LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA);
202typedef DWORD (PASCAL *LPD3DHAL_DRAWPRIMITIVESCB) (LPD3DHAL_DRAWPRIMITIVESDATA);
203
204typedef struct _D3DHAL_CALLBACKS2 {
205 DWORD dwSize;
206 DWORD dwFlags;
207 LPD3DHAL_SETRENDERTARGETCB SetRenderTarget;
208 LPD3DHAL_CLEARCB Clear;
209 LPD3DHAL_DRAWONEPRIMITIVECB DrawOnePrimitive;
210 LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB DrawOneIndexedPrimitive;
211 LPD3DHAL_DRAWPRIMITIVESCB DrawPrimitives;
212} D3DHAL_CALLBACKS2,*LPD3DHAL_CALLBACKS2;
213
214typedef struct _D3DHAL_CLEAR2DATA *LPD3DHAL_CLEAR2DATA;
215typedef struct _D3DHAL_VALIDATETEXTURESTAGESTATEDATA *LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA;
216typedef struct _D3DHAL_DRAWPRIMITIVES2DATA *LPD3DHAL_DRAWPRIMITIVES2DATA;
217
218typedef DWORD (PASCAL *LPD3DHAL_CLEAR2CB) (LPD3DHAL_CLEAR2DATA);
219typedef DWORD (PASCAL *LPD3DHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA);
220typedef DWORD (PASCAL *LPD3DHAL_DRAWPRIMITIVES2CB) (LPD3DHAL_DRAWPRIMITIVES2DATA);
221
222typedef struct _D3DHAL_CALLBACKS3 {
223 DWORD dwSize;
224 DWORD dwFlags;
225 LPD3DHAL_CLEAR2CB Clear2;
226 LPVOID lpvReserved;
227 LPD3DHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState;
228 LPD3DHAL_DRAWPRIMITIVES2CB DrawPrimitives2;
229} D3DHAL_CALLBACKS3,*LPD3DHAL_CALLBACKS3;
230
231/*****************************************************************************
232 * parameter structures
233 */
234typedef struct _D3DHAL_CONTEXTCREATEDATA {
235 _ANONYMOUS_UNION union {
236 LPDDRAWI_DIRECTDRAW_GBL lpDDGbl; /* pre-DirectX 7 */
237 LPDDRAWI_DIRECTDRAW_LCL lpDDLcl; /* DirectX 7 */
238 } DUMMYUNIONNAME1;
239 _ANONYMOUS_UNION union {
240 LPDIRECTDRAWSURFACE lpDDS;
241 LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; /* DirectX 7 */
242 } DUMMYUNIONNAME2;
243 _ANONYMOUS_UNION union {
244 LPDIRECTDRAWSURFACE lpDDSZ;
245 LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl; /* DirectX 7 */
246 } DUMMYUNIONNAME3;
247 _ANONYMOUS_UNION union {
248 DWORD dwPID;
249 ULONG_PTR dwrstates;
250 } DUMMYUNIONNAME4;
251 ULONG_PTR dwhContext;
252 HRESULT ddrval;
253} D3DHAL_CONTEXTCREATEDATA;
254
255typedef struct _D3DHAL_CONTEXTDESTROYDATA {
256 ULONG_PTR dwhContext;
257 HRESULT ddrval;
258} D3DHAL_CONTEXTDESTROYDATA;
259
260typedef struct _D3DHAL_CONTEXTDESTROYALLDATA {
261 DWORD dwPID;
262 HRESULT ddrval;
263} D3DHAL_CONTEXTDESTROYALLDATA;
264
265typedef struct _D3DHAL_SCENECAPTUREDATA {
266 ULONG_PTR dwhContext;
267 DWORD dwFlag;
268 HRESULT ddrval;
269} D3DHAL_SCENECAPTUREDATA;
270
271#define D3DHAL_SCENE_CAPTURE_START 0x00000000
272#define D3DHAL_SCENE_CAPTURE_END 0x00000001
273
274typedef struct _D3DHAL_SETRENDERTARGETDATA {
275 ULONG_PTR dwhContext;
276 _ANONYMOUS_UNION union {
277 LPDIRECTDRAWSURFACE lpDDS;
278 LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl;
279 } DUMMYUNIONNAME1;
280 _ANONYMOUS_UNION union {
281 LPDIRECTDRAWSURFACE lpDDSZ;
282 LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl;
283 } DUMMYUNIONNAME2;
284 HRESULT ddrval;
285} D3DHAL_SETRENDERTARGETDATA;
286
287typedef struct _D3DHAL_DRAWPRIMITIVES2DATA {
288 ULONG_PTR dwhContext;
289 DWORD dwFlags;
290 DWORD dwVertexType;
291 LPDDRAWI_DDRAWSURFACE_LCL lpDDCommands;
292 DWORD dwCommandOffset;
293 DWORD dwCommandLength;
294 _ANONYMOUS_UNION union {
295 LPDDRAWI_DDRAWSURFACE_LCL lpDDVertex;
296 LPVOID lpVertices;
297 } DUMMYUNIONNAME1;
298 DWORD dwVertexOffset;
299 DWORD dwVertexLength;
300 DWORD dwReqVertexBufSize;
301 DWORD dwReqCommandBufSize;
302 LPDWORD lpdwRStates;
303 _ANONYMOUS_UNION union {
304 DWORD dwVertexSize;
305 HRESULT ddrval;
306 } DUMMYUNIONNAME2;
307 DWORD dwErrorOffset;
308} D3DHAL_DRAWPRIMITIVES2DATA;
309
310#define D3DHALDP2_USERMEMVERTICES 0x00000001
311#define D3DHALDP2_EXECUTEBUFFER 0x00000002
312#define D3DHALDP2_SWAPVERTEXBUFFER 0x00000004
313#define D3DHALDP2_SWAPCOMMANDBUFFER 0x00000008
314#define D3DHALDP2_REQVERTEXBUFSIZE 0x00000010
315#define D3DHALDP2_REQCOMMANDBUFSIZE 0x00000020
316#define D3DHALDP2_VIDMEMVERTEXBUF 0x00000040
317#define D3DHALDP2_VIDMEMCOMMANDBUF 0x00000080
318
319/*****************************************************************************
320 * DrawPrimitives2 command structures
321 */
322typedef struct _D3DHAL_DP2COMMAND {
323 BYTE bCommand;
324 BYTE bReserved;
325 _ANONYMOUS_UNION union {
326 WORD wPrimitiveCount;
327 WORD wStateCount;
328 } DUMMYUNIONNAME;
329} D3DHAL_DP2COMMAND,*LPD3DHAL_DP2COMMAND;
330
331typedef enum _D3DHAL_DP2OPERATION {
332 D3DDP2OP_POINTS = 1,
333 D3DDP2OP_INDEXEDLINELIST = 2,
334 D3DDP2OP_INDEXEDTRIANGLELIST = 3,
335 D3DDP2OP_RENDERSTATE = 8,
336 D3DDP2OP_LINELIST = 15,
337 D3DDP2OP_LINESTRIP = 16,
338 D3DDP2OP_INDEXEDLINESTRIP = 17,
339 D3DDP2OP_TRIANGLELIST = 18,
340 D3DDP2OP_TRIANGLESTRIP = 19,
341 D3DDP2OP_INDEXEDTRIANGLESTRIP = 20,
342 D3DDP2OP_TRIANGLEFAN = 21,
343 D3DDP2OP_INDEXEDTRIANGLEFAN = 22,
344 D3DDP2OP_TRIANGLEFAN_IMM = 23,
345 D3DDP2OP_LINELIST_IMM = 24,
346 D3DDP2OP_TEXTURESTAGESTATE = 25,
347 D3DDP2OP_INDEXEDTRIANGLELIST2 = 26,
348 D3DDP2OP_INDEXEDLINELIST2 = 27,
349 D3DDP2OP_VIEWPORTINFO = 28,
350 D3DDP2OP_WINFO = 29,
351 /* pre-DirectX 7 interfaces */
352 D3DDP2OP_SETPALETTE = 30,
353 D3DDP2OP_UPDATEPALETTE = 31,
354 /* DirectX 7 interfaces */
355 D3DDP2OP_ZRANGE = 32,
356 D3DDP2OP_SETMATERIAL = 33,
357 D3DDP2OP_SETLIGHT = 34,
358 D3DDP2OP_CREATELIGHT = 35,
359 D3DDP2OP_SETTRANSFORM = 36,
360 D3DDP2OP_TEXBLT = 38,
361 D3DDP2OP_STATESET = 39,
362 D3DDP2OP_SETPRIORITY = 40,
363 /* all interfaces */
364 D3DDP2OP_SETRENDERTARGET = 41,
365 D3DDP2OP_CLEAR = 42,
366 /* DirectX 7 interfaces */
367 D3DDP2OP_SETTEXLOD = 43,
368 D3DPP2OP_SETCLIPPLANE = 44,
369#if(DIRECT3D_VERSION >= 0x0800)
370 D3DDP2OP_CREATEVERTEXSHADER = 45,
371 D3DDP2OP_DELETEVERTEXSHADER = 46,
372 D3DDP2OP_SETVERTEXSHADER = 47,
373 D3DDP2OP_SETVERTEXSHADERCONST = 48,
374 D3DDP2OP_SETSTREAMSOURCE = 49,
375 D3DDP2OP_SETSTREAMSOURCEUM = 50,
376 D3DDP2OP_SETINDICES = 51,
377 D3DDP2OP_DRAWPRIMITIVE = 52,
378 D3DDP2OP_DRAWINDEXEDPRIMITIVE = 53,
379 D3DDP2OP_CREATEPIXELSHADER = 54,
380 D3DDP2OP_DELETEPIXELSHADER = 55,
381 D3DDP2OP_SETPIXELSHADER = 56,
382 D3DDP2OP_SETPIXELSHADERCONST = 57,
383 D3DDP2OP_CLIPPEDTRIANGLEFAN = 58,
384 D3DDP2OP_DRAWPRIMITIVE2 = 59,
385 D3DDP2OP_DRAWINDEXEDPRIMITIVE2= 60,
386 D3DDP2OP_DRAWRECTPATCH = 61,
387 D3DDP2OP_DRAWTRIPATCH = 62,
388 D3DDP2OP_VOLUMEBLT = 63,
389 D3DDP2OP_BUFFERBLT = 64,
390 D3DDP2OP_MULTIPLYTRANSFORM = 65,
391 D3DDP2OP_ADDDIRTYRECT = 66,
392 D3DDP2OP_ADDDIRTYBOX = 67,
393#endif
394#if(DIRECT3D_VERSION >= 0x0900)
395 D3DDP2OP_CREATEVERTEXSHADERDECL = 71,
396 D3DDP2OP_DELETEVERTEXSHADERDECL = 72,
397 D3DDP2OP_SETVERTEXSHADERDECL = 73,
398 D3DDP2OP_CREATEVERTEXSHADERFUNC = 74,
399 D3DDP2OP_DELETEVERTEXSHADERFUNC = 75,
400 D3DDP2OP_SETVERTEXSHADERFUNC = 76,
401 D3DDP2OP_SETVERTEXSHADERCONSTI= 77,
402 D3DDP2OP_SETSCISSORRECT = 79,
403 D3DDP2OP_SETSTREAMSOURCE2 = 80,
404 D3DDP2OP_BLT = 81,
405 D3DDP2OP_COLORFILL = 82,
406 D3DDP2OP_SETVERTEXSHADERCONSTB= 83,
407 D3DDP2OP_CREATEQUERY = 84,
408 D3DDP2OP_SETRENDERTARGET2 = 85,
409 D3DDP2OP_SETDEPTHSTENCIL = 86,
410 D3DDP2OP_RESPONSECONTINUE = 87,
411 D3DDP2OP_RESPONSEQUERY = 88,
412 D3DDP2OP_GENERATEMIPSUBLEVELS = 89,
413 D3DDP2OP_DELETEQUERY = 90,
414 D3DDP2OP_ISSUEQUERY = 91,
415 D3DDP2OP_SETPIXELSHADERCONSTI = 93,
416 D3DDP2OP_SETPIXELSHADERCONSTB = 94,
417 D3DDP2OP_SETSTREAMSOURCEFREQ = 95,
418 D3DDP2OP_SURFACEBLT = 96
419#endif
420} D3DHAL_DP2OPERATION;
421
422/* point primitives */
423
424typedef struct _D3DHAL_POINTS {
425 WORD wCount;
426 WORD wVStart;
427} D3DHAL_DP2POINTS,*LPD3DHAL_DP2POINTS;
428
429/* line primitives */
430
431typedef struct _D3DHAL_DP2STARTVERTEX {
432 WORD wVStart;
433} D3DHAL_DP2STARTVERTEX,*LPD3DHAL_DP2STARTVERTEX;
434
435typedef struct _D3DHAL_DP2LINELIST {
436 WORD wVStart;
437} D3DHAL_DP2LINELIST,*LPD3DHAL_DP2LINELIST;
438
439typedef struct _D3DHAL_DP2INDEXEDLINELIST {
440 WORD wV1;
441 WORD wV2;
442} D3DHAL_DP2INDEXEDLINELIST,*LPD3DHAL_DP2INDEXEDLINELIST;
443
444typedef struct _D3DHAL_DP2LINESTRIP {
445 WORD wVStart;
446} D3DHAL_DP2LINESTRIP,*LPD3DHAL_DP2LINESTRIP;
447
448typedef struct _D3DHAL_DP2INDEXEDLINESTRIP {
449 WORD wV[2];
450} D3DHAL_DP2INDEXEDLINESTRIP,*LPD3DHAL_DP2INDEXEDLINESTRIP;
451
452/* triangle primitives */
453
454typedef struct _D3DHAL_DP2TRIANGLELIST {
455 WORD wVStart;
456} D3DHAL_DP2TRIANGLELIST,*LPD3DHAL_DP2TRIANGLELIST;
457
458typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST {
459 WORD wV1;
460 WORD wV2;
461 WORD wV3;
462 WORD wFlags;
463} D3DHAL_DP2INDEXEDTRIANGLELIST,*LPD3DHAL_DP2INDEXEDTRIANGLELIST;
464
465typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST2 {
466 WORD wV1;
467 WORD wV2;
468 WORD wV3;
469} D3DHAL_DP2INDEXEDTRIANGLELIST2,*LPD3DHAL_DP2INDEXEDTRIANGLELIST2;
470
471typedef struct _D3DHAL_DP2TRIANGLESTRIP {
472 WORD wVStart;
473} D3DHAL_DP2TRIANGLESTRIP,*LPD3DHAL_DP2TRIANGLESTRIP;
474
475typedef struct _D3DHAL_DP2INDEXEDTRIANGLESTRIP {
476 WORD wV[3];
477} D3DHAL_DP2INDEXEDTRIANGLESTRIP,*LPD3DHAL_DP2INDEXEDTRIANGLESTRIP;
478
479typedef struct _D3DHAL_DP2TRIANGLEFAN {
480 WORD wVStart;
481} D3DHAL_DP2TRIANGLEFAN,*LPD3DHAL_DP2TRIANGLEFAN;
482
483typedef struct _D3DHAL_DP2INDEXEDTRIANGLEFAN {
484 WORD wV[3];
485} D3DHAL_DP2INDEXEDTRIANGLEFAN,*LPD3DHAL_DP2INDEXEDTRIANGLEFAN;
486
487typedef struct _D3DHAL_DP2TRIANGLEFAN_IMM {
488 DWORD dwEdgeFlags;
489} D3DHAL_DP2TRIANGLEFAN_IMM,*LPD3DHAL_DP2TRIANGLEFAN_IMM;
490
491/* render states */
492typedef struct _D3DHAL_DP2RENDERSTATE {
493 D3DRENDERSTATETYPE RenderState;
494 _ANONYMOUS_UNION union {
495 D3DVALUE dvState;
496 DWORD dwState;
497 } DUMMYUNIONNAME;
498} D3DHAL_DP2RENDERSTATE,*LPD3DHAL_DP2RENDERSTATE;
499
500typedef struct _D3DHAL_DP2TEXTURESTAGESTATE {
501 WORD wStage;
502 WORD TSState;
503 DWORD dwValue;
504} D3DHAL_DP2TEXTURESTAGESTATE,*LPD3DHAL_DP2TEXTURESTAGESTATE;
505
506#define D3DTSS_TEXTUREMAP 0
507
508typedef struct _D3DHAL_DP2VIEWPORTINFO {
509 DWORD dwX;
510 DWORD dwY;
511 DWORD dwWidth;
512 DWORD dwHeight;
513} D3DHAL_DP2VIEWPORTINFO,*LPD3DHAL_DP2VIEWPORTINFO;
514
515typedef struct _D3DHAL_DP2WINFO {
516 D3DVALUE dwWNear;
517 D3DVALUE dwWFar;
518} D3DHAL_DP2WINFO,*LPD3DHAL_DP2WINFO;
519
520typedef struct _D3DHAL_DP2SETPALETTE {
521 DWORD dwPaletteHandle;
522 DWORD dwPaletteFlags;
523 DWORD dwSurfaceHandle;
524} D3DHAL_DP2SETPALETTE,*LPD3DHAL_DP2SETPALETTE;
525
526typedef struct _D3DHAL_DP2UPDATEPALETTE {
527 DWORD dwPaletteHandle;
528 WORD wStartIndex;
529 WORD wNumEntries;
530} D3DHAL_DP2UPDATEPALETTE,*LPD3DHAL_DP2UPDATEPALETTE;
531
532typedef struct _D3DHAL_DP2ZRANGE {
533 D3DVALUE dvMinZ;
534 D3DVALUE dvMaxZ;
535} D3DHAL_DP2ZRANGE,*LPD3DHAL_DP2ZRANGE;
536
537typedef D3DMATERIAL7 D3DHAL_DP2SETMATERIAL,*LPD3DHAL_DP2SETMATERIAL;
538
539typedef struct _D3DHAL_DP2SETLIGHT {
540 DWORD dwIndex;
541 DWORD dwDataType;
542} D3DHAL_DP2SETLIGHT,*LPD3DHAL_DP2SETLIGHT;
543
544#define D3DHAL_SETLIGHT_ENABLE 0
545#define D3DHAL_SETLIGHT_DISABLE 1
546#define D3DHAL_SETLIGHT_DATA 2
547
548typedef struct _D3DHAL_DP2CREATELIGHT {
549 DWORD dwIndex;
550} D3DHAL_DP2CREATELIGHT,*LPD3DHAL_DP2CREATELIGHT;
551
552typedef struct _D3DHAL_DP2SETTRANSFORM {
553 D3DTRANSFORMSTATETYPE xfrmType;
554 D3DMATRIX matrix;
555} D3DHAL_DP2SETTRANSFORM,*LPD3DHAL_DP2SETTRANSFORM;
556
557typedef struct _D3DHAL_DP2TEXBLT {
558 DWORD dwDDDestSurface;
559 DWORD dwDDSrcSurface;
560 POINT pDest;
561 RECTL rSrc;
562 DWORD dwFlags;
563} D3DHAL_DP2TEXBLT,*LPD3DHAL_DP2TEXBLT;
564
565typedef struct _D3DHAL_DP2STATESET {
566 DWORD dwOperation;
567 DWORD dwParam;
568 D3DSTATEBLOCKTYPE sbType;
569} D3DHAL_DP2STATESET,*LPD3DHAL_DP2STATESET;
570
571#define D3DHAL_STATESETBEGIN 0
572#define D3DHAL_STATESETEND 1
573#define D3DHAL_STATESETDELETE 2
574#define D3DHAL_STATESETEXECUTE 3
575#define D3DHAL_STATESETCAPTURE 4
576
577typedef struct _D3DHAL_DP2SETPRIORITY {
578 DWORD dwDDSurface;
579 DWORD dwPriority;
580} D3DHAL_DP2SETPRIORITY,*LPD3DHAL_DP2SETPRIORITY;
581
582typedef struct _D3DHAL_DP2SETRENDERTARGET {
583 DWORD hRenderTarget;
584 DWORD hZBuffer;
585} D3DHAL_DP2SETRENDERTARGET,*LPD3DHAL_DP2SETRENDERTARGET;
586
587typedef struct _D3DHAL_DP2CLEAR {
588 DWORD dwFlags;
589 DWORD dwFillColor;
590 D3DVALUE dvFillDepth;
591 DWORD dwFillStencil;
592 RECT Rects[1];
593} D3DHAL_DP2CLEAR,*LPD3DHAL_DP2CLEAR;
594
595typedef struct _D3DHAL_DP2SETTEXLOD {
596 DWORD dwDDSurface;
597 DWORD dwLOD;
598} D3DHAL_DP2SETTEXLOD,*LPD3DHAL_DP2SETTEXLOD;
599
600
601#if (DIRECT3D_VERSION >= 0x0900)
602
603#define DX9_DDI_VERSION 4
604
605#ifndef D3DVTXPCAPS_NO_VSDT_UBYTE4
606#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080
607#endif
608
609#ifndef D3DPMISCCAPS_LINEPATTERNREP
610#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004
611#endif
612
613#define D3DDEVCAPS_HWVERTEXBUFFER 0x02000000
614#define D3DDEVCAPS_HWINDEXBUFFER 0x04000000
615#define D3DDEVCAPS_SUBVOLUMELOCK 0x08000000
616
617#ifndef D3DPMISCCAPS_FOGINFVF
618#define D3DPMISCCAPS_FOGINFVF 0x00002000
619#endif
620
621#ifndef D3DFVF_FOG
622#define D3DFVF_FOG 0x00002000
623#endif
624
625typedef struct _DD_GETDRIVERINFO2DATA {
626 DWORD dwReserved;
627 DWORD dwMagic;
628 DWORD dwType;
629 DWORD dwExpectedSize;
630} DD_GETDRIVERINFO2DATA;
631
632/**
633 * A driver must check DD_GETDRIVERINFO2DATA.dwHeight for
634 * D3DGDI2_MAGIC to see if the passed GUID is GUID_GetDriverInfo2
635 * or a GUID_DDStereoMode.
636 */
637#define GUID_GetDriverInfo2 GUID_DDStereoMode
638
639/**
640 * Magic number used in DD_GETDRIVERINFO2DATA.dwHeight when
641 * GUID_GetDriverInfo2/GUID_DDStereoMode is specified in a
642 * GetDriverInfo call.
643 */
644#define D3DGDI2_MAGIC 0xFFFFFFFF
645
646#define D3DGDI2_TYPE_GETD3DCAPS8 0x00000001
647#define D3DGDI2_TYPE_GETFORMATCOUNT 0x00000002
648#define D3DGDI2_TYPE_GETFORMAT 0x00000003
649#define D3DGDI2_TYPE_DXVERSION 0x00000004 /* Make driver aware of currently used DirectX version */
650#define D3DGDI2_TYPE_GETD3DCAPS9 0x00000010
651#define D3DGDI2_TYPE_GETEXTENDEDMODECOUNT 0x00000011
652#define D3DGDI2_TYPE_GETEXTENDEDMODE 0x00000012
653#define D3DGDI2_TYPE_GETADAPTERGROUP 0x00000013
654#define D3DGDI2_TYPE_GETMULTISAMPLEQUALITYLEVELS 0x00000016
655#define D3DGDI2_TYPE_DEFERRED_AGP_AWARE 0x00000018
656#define D3DGDI2_TYPE_FREE_DEFERRED_AGP 0x00000019
657#define D3DGDI2_TYPE_DEFER_AGP_FREES 0x00000020
658#define D3DGDI2_TYPE_GETD3DQUERYCOUNT 0x00000021
659#define D3DGDI2_TYPE_GETD3DQUERY 0x00000022
660#define D3DGDI2_TYPE_GETDDIVERSION 0x00000023 /* Returns DX9_DDI_VERSION, used to check which DDK version the driver is compiled against */
661
662typedef struct _D3DCAPS8 {
663 D3DDEVTYPE DeviceType;
664 UINT AdapterOrdinal;
665 DWORD Caps;
666 DWORD Caps2;
667 DWORD Caps3;
668 DWORD PresentationIntervals;
669 DWORD CursorCaps;
670 DWORD DevCaps;
671 DWORD PrimitiveMiscCaps;
672 DWORD RasterCaps;
673 DWORD ZCmpCaps;
674 DWORD SrcBlendCaps;
675 DWORD DestBlendCaps;
676 DWORD AlphaCmpCaps;
677 DWORD ShadeCaps;
678 DWORD TextureCaps;
679 DWORD TextureFilterCaps;
680 DWORD CubeTextureFilterCaps;
681 DWORD VolumeTextureFilterCaps;
682 DWORD TextureAddressCaps;
683 DWORD VolumeTextureAddressCaps;
684 DWORD LineCaps;
685 DWORD MaxTextureWidth;
686 DWORD MaxTextureHeight;
687 DWORD MaxVolumeExtent;
688 DWORD MaxTextureRepeat;
689 DWORD MaxTextureAspectRatio;
690 DWORD MaxAnisotropy;
691 float MaxVertexW;
692 float GuardBandLeft;
693 float GuardBandTop;
694 float GuardBandRight;
695 float GuardBandBottom;
696 float ExtentsAdjust;
697 DWORD StencilCaps;
698 DWORD FVFCaps;
699 DWORD TextureOpCaps;
700 DWORD MaxTextureBlendStages;
701 DWORD MaxSimultaneousTextures;
702 DWORD VertexProcessingCaps;
703 DWORD MaxActiveLights;
704 DWORD MaxUserClipPlanes;
705 DWORD MaxVertexBlendMatrices;
706 DWORD MaxVertexBlendMatrixIndex;
707 float MaxPointSize;
708 DWORD MaxPrimitiveCount;
709 DWORD MaxVertexIndex;
710 DWORD MaxStreams;
711 DWORD MaxStreamStride;
712 DWORD VertexShaderVersion;
713 DWORD MaxVertexShaderConst;
714 DWORD PixelShaderVersion;
715 float MaxPixelShaderValue;
716} D3DCAPS8;
717
718typedef struct _DD_GETFORMATCOUNTDATA {
719 DD_GETDRIVERINFO2DATA gdi2;
720 DWORD dwFormatCount;
721 DWORD dwReserved;
722} DD_GETFORMATCOUNTDATA;
723
724typedef struct _DD_GETFORMATDATA {
725 DD_GETDRIVERINFO2DATA gdi2;
726 DWORD dwFormatIndex;
727 DDPIXELFORMAT format;
728} DD_GETFORMATDATA;
729
730typedef struct _DD_DXVERSION {
731 DD_GETDRIVERINFO2DATA gdi2;
732 DWORD dwDXVersion;
733 DWORD dwReserved;
734} DD_DXVERSION;
735
736typedef struct _DD_DEFERRED_AGP_AWARE_DATA {
737 DD_GETDRIVERINFO2DATA gdi2;
738} DD_DEFERRED_AGP_AWARE_DATA;
739
740typedef struct _DD_FREE_DEFERRED_AGP_DATA {
741 DD_GETDRIVERINFO2DATA gdi2;
742 DWORD dwProcessId;
743} DD_FREE_DEFERRED_AGP_DATA;
744
745typedef struct _DD_GETEXTENDEDMODECOUNTDATA {
746 DD_GETDRIVERINFO2DATA gdi2;
747 DWORD dwModeCount;
748 DWORD dwReserved;
749} DD_GETEXTENDEDMODECOUNTDATA;
750
751typedef struct _DD_GETEXTENDEDMODEDATA {
752 DD_GETDRIVERINFO2DATA gdi2;
753 DWORD dwModeIndex;
754 D3DDISPLAYMODE mode;
755} DD_GETEXTENDEDMODEDATA;
756
757typedef struct _DD_GETADAPTERGROUPDATA {
758 DD_GETDRIVERINFO2DATA gdi2;
759 ULONG_PTR ulUniqueAdapterGroupId;
760 DWORD dwReserved1;
761 DWORD dwReserved2;
762} DD_GETADAPTERGROUPDATA;
763
764typedef struct _DD_MULTISAMPLEQUALITYLEVELSDATA {
765 DD_GETDRIVERINFO2DATA gdi2;
766 D3DFORMAT Format;
767 BOOL bFlip : 1;
768 D3DMULTISAMPLE_TYPE MSType : 31;
769 DWORD QualityLevels;
770} DD_MULTISAMPLEQUALITYLEVELSDATA;
771
772typedef struct _DD_GETD3DQUERYCOUNTDATA {
773 DD_GETDRIVERINFO2DATA gdi2;
774 DWORD dwNumQueries;
775} DD_GETD3DQUERYCOUNTDATA;
776
777typedef struct _DD_GETD3DQUERYDATA {
778 DD_GETDRIVERINFO2DATA gdi2;
779 __GNU_EXTENSION union {
780 DWORD dwQueryIndex;
781 D3DQUERYTYPE QueryType;
782 };
783} DD_GETD3DQUERYDATA;
784
785typedef struct _DD_GETDDIVERSIONDATA {
786 DD_GETDRIVERINFO2DATA gdi2;
787 DWORD dwDXVersion;
788 DWORD dwDDIVersion;
789} DD_GETDDIVERSIONDATA;
790
791#endif /* (DIRECT3D_VERSION >= 0x0900) */
792
793#ifdef __cplusplus
794} /* extern "C" */
795#endif
796
797#endif /* _D3DHAL_H_ */
Note: See TracBrowser for help on using the repository browser.