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