1 /* Direct3D driver interface */
2 /* (DirectX 7 version) */
4 #ifndef __WINE_D3DHAL_H
5 #define __WINE_D3DHAL_H
13 /*****************************************************************************
14 * device info structures
16 typedef struct _D3DDeviceDesc_V1
{
19 D3DCOLORMODEL dcmColorModel
;
21 D3DTRANSFORMCAPS dtcTransformCaps
;
23 D3DLIGHTINGCAPS dlcLightingCaps
;
24 D3DPRIMCAPS dpcLineCaps
;
25 D3DPRIMCAPS dpcTriCaps
;
26 DWORD dwDeviceRenderBitDepth
;
27 DWORD dwDeviceZBufferBitDepth
;
28 DWORD dwMaxBufferSize
;
29 DWORD dwMaxVertexCount
;
30 } D3DDEVICEDESC_V1
,*LPD3DDEVICEDESC_V1
;
32 /* this is to allow keeping the bulk of our OpenGL code out of x11drv */
33 #define D3DDD_WINE_OPENGL_DEVICE 0x00008000
35 typedef struct _D3DHAL_GLOBALDRIVERDATA
{
37 D3DDEVICEDESC_V1 hwCaps
;
39 DWORD dwNumClipVertices
;
40 DWORD dwNumTextureFormats
;
41 LPDDSURFACEDESC lpTextureFormats
;
42 } D3DHAL_GLOBALDRIVERDATA
,*LPD3DHAL_GLOBALDRIVERDATA
;
44 typedef struct _D3DHAL_D3DEXTENDEDCAPS
{
47 DWORD dwMinTextureWidth
, dwMaxTextureWidth
;
48 DWORD dwMinTextureHeight
, dwMaxTextureHeight
;
49 DWORD dwMinStippleWidth
, dwMaxStippleWidth
;
50 DWORD dwMinStippleHeight
, dwMaxStippleHeight
;
52 DWORD dwMaxTextureRepeat
;
53 DWORD dwMaxTextureAspectRatio
;
54 DWORD dwMaxAnisotropy
;
55 D3DVALUE dvGuardBandLeft
;
56 D3DVALUE dvGuardBandTop
;
57 D3DVALUE dvGuardBandRight
;
58 D3DVALUE dvGuardBandBottom
;
59 D3DVALUE dvExtentsAdjust
;
62 DWORD dwTextureOpCaps
;
63 WORD wMaxTextureBlendStages
;
64 WORD wMaxSimultaneousTextures
;
66 DWORD dwMaxActiveLights
;
67 D3DVALUE dvMaxVertexW
;
68 WORD wMaxUserClipPlanes
;
69 WORD wMaxVertexBlendMatrices
;
70 DWORD dwVertexProcessingCaps
;
75 } D3DHAL_D3DEXTENDEDCAPS
,*LPD3DHAL_D3DEXTENDEDCAPS
;
77 /*****************************************************************************
78 * d3d->driver callbacks
80 typedef struct _D3DHAL_CONTEXTCREATEDATA
*LPD3DHAL_CONTEXTCREATEDATA
;
81 typedef struct _D3DHAL_CONTEXTDESTROYDATA
*LPD3DHAL_CONTEXTDESTROYDATA
;
82 typedef struct _D3DHAL_CONTEXTDESTROYALLDATA
*LPD3DHAL_CONTEXTDESTROYALLDATA
;
83 typedef struct _D3DHAL_SCENECAPTUREDATA
*LPD3DHAL_SCENECAPTUREDATA
;
84 typedef struct _D3DHAL_RENDERSTATEDATA
*LPD3DHAL_RENDERSTATEDATA
;
85 typedef struct _D3DHAL_RENDERPRIMITIVEDATA
*LPD3DHAL_RENDERPRIMITIVEDATA
;
86 typedef struct _D3DHAL_TEXTURECREATEDATA
*LPD3DHAL_TEXTURECREATEDATA
;
87 typedef struct _D3DHAL_TEXTUREDESTROYDATA
*LPD3DHAL_TEXTUREDESTROYDATA
;
88 typedef struct _D3DHAL_TEXTURESWAPDATA
*LPD3DHAL_TEXTURESWAPDATA
;
89 typedef struct _D3DHAL_TEXTUREGETSURFDATA
*LPD3DHAL_TEXTUREGETSURFDATA
;
90 typedef struct _D3DHAL_GETSTATEDATA
*LPD3DHAL_GETSTATEDATA
;
92 typedef DWORD
PASCAL (*LPD3DHAL_CONTEXTCREATECB
) (LPD3DHAL_CONTEXTCREATEDATA
);
93 typedef DWORD
PASCAL (*LPD3DHAL_CONTEXTDESTROYCB
) (LPD3DHAL_CONTEXTDESTROYDATA
);
94 typedef DWORD
PASCAL (*LPD3DHAL_CONTEXTDESTROYALLCB
)(LPD3DHAL_CONTEXTDESTROYALLDATA
);
95 typedef DWORD
PASCAL (*LPD3DHAL_SCENECAPTURECB
) (LPD3DHAL_SCENECAPTUREDATA
);
96 typedef DWORD
PASCAL (*LPD3DHAL_RENDERSTATECB
) (LPD3DHAL_RENDERSTATEDATA
);
97 typedef DWORD
PASCAL (*LPD3DHAL_RENDERPRIMITIVECB
) (LPD3DHAL_RENDERPRIMITIVEDATA
);
98 typedef DWORD
PASCAL (*LPD3DHAL_TEXTURECREATECB
) (LPD3DHAL_TEXTURECREATEDATA
);
99 typedef DWORD
PASCAL (*LPD3DHAL_TEXTUREDESTROYCB
) (LPD3DHAL_TEXTUREDESTROYDATA
);
100 typedef DWORD
PASCAL (*LPD3DHAL_TEXTURESWAPCB
) (LPD3DHAL_TEXTURESWAPDATA
);
101 typedef DWORD
PASCAL (*LPD3DHAL_TEXTUREGETSURFCB
) (LPD3DHAL_TEXTUREGETSURFDATA
);
102 typedef DWORD
PASCAL (*LPD3DHAL_GETSTATECB
) (LPD3DHAL_GETSTATEDATA
);
104 typedef struct _D3DHAL_CALLBACKS
{
106 LPD3DHAL_CONTEXTCREATECB ContextCreate
;
107 LPD3DHAL_CONTEXTDESTROYCB ContextDestroy
;
108 LPD3DHAL_CONTEXTDESTROYALLCB ContextDestroyAll
;
109 LPD3DHAL_SCENECAPTURECB SceneCapture
;
112 LPD3DHAL_RENDERSTATECB RenderState
;
113 LPD3DHAL_RENDERPRIMITIVECB RenderPrimitive
;
115 LPD3DHAL_TEXTURECREATECB TextureCreate
;
116 LPD3DHAL_TEXTUREDESTROYCB TextureDestroy
;
117 LPD3DHAL_TEXTURESWAPCB TextureSwap
;
118 LPD3DHAL_TEXTUREGETSURFCB TextureGetSurf
;
119 /* now why did MS create CALLBACKS2 and CALLBACKS3 structures if
120 * all these reserved fields were available? we may never know */
131 LPD3DHAL_GETSTATECB GetState
;
142 } D3DHAL_CALLBACKS
,*LPD3DHAL_CALLBACKS
;
144 typedef struct _D3DHAL_SETRENDERTARGETDATA
*LPD3DHAL_SETRENDERTARGETDATA
;
145 typedef struct _D3DHAL_CLEARDATA
*LPD3DHAL_CLEARDATA
;
146 typedef struct _D3DHAL_DRAWONEPRIMITIVEDATA
*LPD3DHAL_DRAWONEPRIMITIVEDATA
;
147 typedef struct _D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA
*LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA
;
148 typedef struct _D3DHAL_DRAWPRIMITIVESDATA
*LPD3DHAL_DRAWPRIMITIVESDATA
;
150 typedef DWORD
PASCAL (*LPD3DHAL_SETRENDERTARGETCB
) (LPD3DHAL_SETRENDERTARGETDATA
);
151 typedef DWORD
PASCAL (*LPD3DHAL_CLEARCB
) (LPD3DHAL_CLEARDATA
);
152 typedef DWORD
PASCAL (*LPD3DHAL_DRAWONEPRIMITIVECB
) (LPD3DHAL_DRAWONEPRIMITIVEDATA
);
153 typedef DWORD
PASCAL (*LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB
)(LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA
);
154 typedef DWORD
PASCAL (*LPD3DHAL_DRAWPRIMITIVESCB
) (LPD3DHAL_DRAWPRIMITIVESDATA
);
156 typedef struct _D3DHAL_CALLBACKS2
{
159 LPD3DHAL_SETRENDERTARGETCB SetRenderTarget
;
160 LPD3DHAL_CLEARCB Clear
;
161 LPD3DHAL_DRAWONEPRIMITIVECB DrawOnePrimitive
;
162 LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB DrawOneIndexedPrimitive
;
163 LPD3DHAL_DRAWPRIMITIVESCB DrawPrimitives
;
164 } D3DHAL_CALLBACKS2
,*LPD3DHAL_CALLBACKS2
;
166 typedef struct _D3DHAL_CLEAR2DATA
*LPD3DHAL_CLEAR2DATA
;
167 typedef struct _D3DHAL_VALIDATETEXTURESTAGESTATEDATA
*LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA
;
168 typedef struct _D3DHAL_DRAWPRIMITIVES2DATA
*LPD3DHAL_DRAWPRIMITIVES2DATA
;
170 typedef DWORD
PASCAL (*LPD3DHAL_CLEAR2CB
) (LPD3DHAL_CLEAR2DATA
);
171 typedef DWORD
PASCAL (*LPD3DHAL_VALIDATETEXTURESTAGESTATECB
)(LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA
);
172 typedef DWORD
PASCAL (*LPD3DHAL_DRAWPRIMITIVES2CB
) (LPD3DHAL_DRAWPRIMITIVES2DATA
);
174 typedef struct _D3DHAL_CALLBACKS3
{
177 LPD3DHAL_CLEAR2CB Clear2
;
179 LPD3DHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState
;
180 LPD3DHAL_DRAWPRIMITIVES2CB DrawPrimitives2
;
181 } D3DHAL_CALLBACKS3
,*LPD3DHAL_CALLBACKS3
;
183 /*****************************************************************************
184 * parameter structures
186 typedef struct _D3DHAL_CONTEXTCREATEDATA
{
188 LPDDRAWI_DIRECTDRAW_GBL lpDDGbl
; /* pre-DirectX 7 */
189 LPDDRAWI_DIRECTDRAW_LCL lpDDLcl
; /* DirectX 7 */
192 LPDIRECTDRAWSURFACE lpDDS
;
193 LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl
; /* DirectX 7 */
196 LPDIRECTDRAWSURFACE lpDDSZ
;
197 LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl
; /* DirectX 7 */
203 ULONG_PTR dwhContext
;
205 } D3DHAL_CONTEXTCREATEDATA
;
207 typedef struct _D3DHAL_CONTEXTDESTROYDATA
{
208 ULONG_PTR dwhContext
;
210 } D3DHAL_CONTEXTDESTROYDATA
;
212 typedef struct _D3DHAL_CONTEXTDESTROYALLDATA
{
215 } D3DHAL_CONTEXTDESTROYALLDATA
;
217 typedef struct _D3DHAL_SCENECAPTUREDATA
{
218 ULONG_PTR dwhContext
;
221 } D3DHAL_SCENECAPTUREDATA
;
223 #define D3DHAL_SCENE_CAPTURE_START 0x00000000
224 #define D3DHAL_SCENE_CAPTURE_END 0x00000001
226 typedef struct _D3DHAL_SETRENDERTARGETDATA
{
227 ULONG_PTR dwhContext
;
229 LPDIRECTDRAWSURFACE lpDDS
;
230 LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl
;
233 LPDIRECTDRAWSURFACE lpDDSZ
;
234 LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl
;
237 } D3DHAL_SETRENDERTARGETDATA
;
239 typedef struct _D3DHAL_DRAWPRIMITIVES2DATA
{
240 ULONG_PTR dwhContext
;
243 LPDDRAWI_DDRAWSURFACE_LCL lpDDCommands
;
244 DWORD dwCommandOffset
;
245 DWORD dwCommandLength
;
247 LPDDRAWI_DDRAWSURFACE_LCL lpDDVertex
;
250 DWORD dwVertexOffset
;
251 DWORD dwVertexLength
;
252 DWORD dwReqVertexBufSize
;
253 DWORD dwReqCommandBufSize
;
260 } D3DHAL_DRAWPRIMITIVES2DATA
;
262 #define D3DHALDP2_USERMEMVERTICES 0x00000001
263 #define D3DHALDP2_EXECUTEBUFFER 0x00000002
264 #define D3DHALDP2_SWAPVERTEXBUFFER 0x00000004
265 #define D3DHALDP2_SWAPCOMMANDBUFFER 0x00000008
266 #define D3DHALDP2_REQVERTEXBUFSIZE 0x00000010
267 #define D3DHALDP2_REQCOMMANDBUFSIZE 0x00000020
268 #define D3DHALDP2_VIDMEMVERTEXBUF 0x00000040
269 #define D3DHALDP2_VIDMEMCOMMANDBUF 0x00000080
271 /*****************************************************************************
272 * DrawPrimitives2 command structures
274 typedef struct _D3DHAL_DP2COMMAND
{
278 WORD wPrimitiveCount
;
281 } D3DHAL_DP2COMMAND
,*LPD3DHAL_DP2COMMAND
;
283 typedef enum _D3DHAL_DP2OPERATION
{
285 D3DDP2OP_INDEXEDLINELIST
= 2,
286 D3DDP2OP_INDEXEDTRIANGLELIST
= 3,
287 D3DDP2OP_RESERVED0
= 4,
288 D3DDP2OP_RENDERSTATE
= 8,
289 D3DDP2OP_LINELIST
= 15,
290 D3DDP2OP_LINESTRIP
= 16,
291 D3DDP2OP_INDEXEDLINESTRIP
= 17,
292 D3DDP2OP_TRIANGLELIST
= 18,
293 D3DDP2OP_TRIANGLESTRIP
= 19,
294 D3DDP2OP_INDEXEDTRIANGLESTRIP
= 20,
295 D3DDP2OP_TRIANGLEFAN
= 21,
296 D3DDP2OP_INDEXEDTRIANGLEFAN
= 22,
297 D3DDP2OP_TRIANGLEFAN_IMM
= 23,
298 D3DDP2OP_LINELIST_IMM
= 24,
299 D3DDP2OP_TEXTURESTAGESTATE
= 25,
300 D3DDP2OP_INDEXEDTRIANGLELIST2
= 26,
301 D3DDP2OP_INDEXEDLINELIST2
= 27,
302 D3DDP2OP_VIEWPORTINFO
= 28,
304 /* pre-DirectX 7 interfaces */
305 D3DDP2OP_SETPALETTE
= 30,
306 D3DDP2OP_UPDATEPALETTE
= 31,
307 /* DirectX 7 interfaces */
308 D3DDP2OP_ZRANGE
= 32,
309 D3DDP2OP_SETMATERIAL
= 33,
310 D3DDP2OP_SETLIGHT
= 34,
311 D3DDP2OP_CREATELIGHT
= 35,
312 D3DDP2OP_SETTRANSFORM
= 36,
314 D3DDP2OP_TEXBLT
= 38,
315 D3DDP2OP_STATESET
= 39,
316 D3DDP2OP_SETPRIORITY
= 40,
318 D3DDP2OP_SETRENDERTARGET
= 41,
320 /* DirectX 7 interfaces */
321 D3DDP2OP_SETTEXLOD
= 43,
322 D3DPP2OP_SETCLIPPLANE
= 44
323 } D3DHAL_DP2OPERATION
;
325 /* point primitives */
327 typedef struct _D3DHAL_POINTS
{
330 } D3DHAL_DP2POINTS
,*LPD3DHAL_DP2POINTS
;
332 /* line primitives */
334 typedef struct _D3DHAL_DP2STARTVERTEX
{
336 } D3DHAL_DP2STARTVERTEX
,*LPD3DHAL_DP2STARTVERTEX
;
338 typedef struct _D3DHAL_DP2LINELIST
{
340 } D3DHAL_DP2LINELIST
,*LPD3DHAL_DP2LINELIST
;
342 typedef struct _D3DHAL_DP2INDEXEDLINELIST
{
345 } D3DHAL_DP2INDEXEDLINELIST
,*LPD3DHAL_DP2INDEXEDLINELIST
;
347 typedef struct _D3DHAL_DP2LINESTRIP
{
349 } D3DHAL_DP2LINESTRIP
,*LPD3DHAL_DP2LINESTRIP
;
351 typedef struct _D3DHAL_DP2INDEXEDLINESTRIP
{
353 } D3DHAL_DP2INDEXEDLINESTRIP
,*LPD3DHAL_DP2INDEXEDLINESTRIP
;
355 /* triangle primitives */
357 typedef struct _D3DHAL_DP2TRIANGLELIST
{
359 } D3DHAL_DP2TRIANGLELIST
,*LPD3DHAL_DP2TRIANGLELIST
;
361 typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST
{
366 } D3DHAL_DP2INDEXEDTRIANGLELIST
,*LPD3DHAL_DP2INDEXEDTRIANGLELIST
;
368 typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST2
{
372 } D3DHAL_DP2INDEXEDTRIANGLELIST2
,*LPD3DHAL_DP2INDEXEDTRIANGLELIST2
;
374 typedef struct _D3DHAL_DP2TRIANGLESTRIP
{
376 } D3DHAL_DP2TRIANGLESTRIP
,*LPD3DHAL_DP2TRIANGLESTRIP
;
378 typedef struct _D3DHAL_DP2INDEXEDTRIANGLESTRIP
{
380 } D3DHAL_DP2INDEXEDTRIANGLESTRIP
,*LPD3DHAL_DP2INDEXEDTRIANGLESTRIP
;
382 typedef struct _D3DHAL_DP2TRIANGLEFAN
{
384 } D3DHAL_DP2TRIANGLEFAN
,*LPD3DHAL_DP2TRIANGLEFAN
;
386 typedef struct _D3DHAL_DP2INDEXEDTRIANGLEFAN
{
388 } D3DHAL_DP2INDEXEDTRIANGLEFAN
,*LPD3DHAL_DP2INDEXEDTRIANGLEFAN
;
390 typedef struct _D3DHAL_DP2TRIANGLEFAN_IMM
{
392 } D3DHAL_DP2TRIANGLEFAN_IMM
,*LPD3DHAL_DP2TRIANGLEFAN_IMM
;
395 typedef struct _D3DHAL_DP2RENDERSTATE
{
396 D3DRENDERSTATETYPE RenderState
;
401 } D3DHAL_DP2RENDERSTATE
,*LPD3DHAL_DP2RENDERSTATE
;
403 typedef struct _D3DHAL_DP2TEXTURESTAGESTATE
{
407 } D3DHAL_DP2TEXTURESTAGESTATE
,*LPD3DHAL_DP2TEXTURESTAGESTATE
;
409 #define D3DTSS_TEXTUREMAP 0
411 typedef struct _D3DHAL_DP2VIEWPORTINFO
{
416 } D3DHAL_DP2VIEWPORTINFO
,*LPD3DHAL_DP2VIEWPORTINFO
;
418 typedef struct _D3DHAL_DP2WINFO
{
421 } D3DHAL_DP2WINFO
,*LPD3DHAL_DP2WINFO
;
423 typedef struct _D3DHAL_DP2SETPALETTE
{
424 DWORD dwPaletteHandle
;
425 DWORD dwPaletteFlags
;
426 DWORD dwSurfaceHandle
;
427 } D3DHAL_DP2SETPALETTE
,*LPD3DHAL_DP2SETPALETTE
;
429 typedef struct _D3DHAL_DP2UPDATEPALETTE
{
430 DWORD dwPaletteHandle
;
433 } D3DHAL_DP2UPDATEPALETTE
,*LPD3DHAL_DP2UPDATEPALETTE
;
435 typedef struct _D3DHAL_DP2ZRANGE
{
438 } D3DHAL_DP2ZRANGE
,*LPD3DHAL_DP2ZRANGE
;
440 typedef D3DMATERIAL7 D3DHAL_DP2SETMATERIAL
,*LPD3DHAL_DP2SETMATERIAL
;
442 typedef struct _D3DHAL_DP2SETLIGHT
{
445 } D3DHAL_DP2SETLIGHT
,*LPD3DHAL_DP2SETLIGHT
;
447 #define D3DHAL_SETLIGHT_ENABLE 0
448 #define D3DHAL_SETLIGHT_DISABLE 1
449 #define D3DHAL_SETLIGHT_DATA 2
451 typedef struct _D3DHAL_DP2CREATELIGHT
{
453 } D3DHAL_DP2CREATELIGHT
,*LPD3DHAL_DP2CREATELIGHT
;
455 typedef struct _D3DHAL_DP2SETTRANSFORM
{
456 D3DTRANSFORMSTATETYPE xfrmType
;
458 } D3DHAL_DP2SETTRANSFORM
,*LPD3DHAL_DP2SETTRANSFORM
;
460 typedef struct _D3DHAL_DP2TEXBLT
{
461 DWORD dwDDDestSurface
;
462 DWORD dwDDSrcSurface
;
466 } D3DHAL_DP2TEXBLT
,*LPD3DHAL_DP2TEXBLT
;
468 typedef struct _D3DHAL_DP2STATESET
{
471 D3DSTATEBLOCKTYPE sbType
;
472 } D3DHAL_DP2STATESET
,*LPD3DHAL_DP2STATESET
;
474 #define D3DHAL_STATESETBEGIN 0
475 #define D3DHAL_STATESETEND 1
476 #define D3DHAL_STATESETDELETE 2
477 #define D3DHAL_STATESETEXECUTE 3
478 #define D3DHAL_STATESETCAPTURE 4
480 typedef struct _D3DHAL_DP2SETPRIORITY
{
483 } D3DHAL_DP2SETPRIORITY
,*LPD3DHAL_DP2SETPRIORITY
;
485 typedef struct _D3DHAL_DP2SETRENDERTARGET
{
488 } D3DHAL_DP2SETRENDERTARGET
,*LPD3DHAL_DP2SETRENDERTARGET
;
490 typedef struct _D3DHAL_DP2CLEAR
{
493 D3DVALUE dvFillDepth
;
496 } D3DHAL_DP2CLEAR
,*LPD3DHAL_DP2CLEAR
;
498 typedef struct _D3DHAL_DP2SETTEXLOD
{
501 } D3DHAL_DP2SETTEXLOD
,*LPD3DHAL_DP2SETTEXLOD
;
507 #endif /* __WINE_DDRAWI_H */