IDirectDrawSurface::Blt::SRCCOPY is the default ROP operation, do not
[wine] / dlls / ddraw / d3d_private.h
1 /* Direct3D private include file
2    (c) 1998 Lionel ULMER
3    
4    This files contains all the structure that are not exported
5    through d3d.h and all common macros. */
6
7 #ifndef __GRAPHICS_WINE_D3D_PRIVATE_H
8 #define __GRAPHICS_WINE_D3D_PRIVATE_H
9
10 /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
11
12 #include "d3d.h"
13
14 /*****************************************************************************
15  * Predeclare the interface implementation structures
16  */
17 typedef struct IDirect3DImpl IDirect3DImpl;
18 typedef struct IDirect3D2Impl IDirect3D2Impl;
19 typedef struct IDirect3D3Impl IDirect3D3Impl;
20
21 typedef struct IDirect3DLightImpl IDirect3DLightImpl;
22 typedef struct IDirect3DMaterial2Impl IDirect3DMaterial2Impl;
23 typedef struct IDirect3DTexture2Impl IDirect3DTexture2Impl;
24 typedef struct IDirect3DViewport2Impl IDirect3DViewport2Impl;
25 typedef struct IDirect3DExecuteBufferImpl IDirect3DExecuteBufferImpl;
26 typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
27 typedef struct IDirect3DDevice2Impl IDirect3DDevice2Impl;
28
29 #include "ddraw_private.h"
30
31 extern ICOM_VTABLE(IDirect3D)   mesa_d3dvt;
32 extern ICOM_VTABLE(IDirect3D2)  mesa_d3d2vt;
33 extern ICOM_VTABLE(IDirect3D3)  mesa_d3d3vt;
34
35 /*****************************************************************************
36  * IDirect3D implementation structure
37  */
38 struct IDirect3DImpl
39 {
40     /* IUnknown fields */
41     ICOM_VFIELD(IDirect3D);
42     DWORD                   ref;
43     /* IDirect3D fields */
44     IDirectDrawImpl*    ddraw;
45     LPVOID              private;
46 };
47
48 /*****************************************************************************
49  * IDirect3D2 implementation structure
50  */
51 struct IDirect3D2Impl
52 {
53     /* IUnknown fields */
54     ICOM_VFIELD(IDirect3D2);
55     DWORD                    ref;
56     /* IDirect3D2 fields */
57     IDirectDrawImpl*    ddraw;
58     LPVOID              private;
59 };
60
61 struct IDirect3D3Impl
62 {
63     /* IUnknown fields */
64     ICOM_VFIELD(IDirect3D3);
65     DWORD                    ref;
66     /* IDirect3D2 fields */
67     IDirectDrawImpl*    ddraw;
68     LPVOID              private;
69     /* IDirect3D3 fields */
70 };
71
72
73 extern HRESULT WINAPI IDirect3DImpl_QueryInterface(
74     LPDIRECT3D iface,REFIID refiid,LPVOID *obj
75 );
76 extern ULONG WINAPI IDirect3DImpl_AddRef(LPDIRECT3D iface);
77 extern ULONG WINAPI IDirect3DImpl_Release(LPDIRECT3D iface)
78 ;
79 extern HRESULT WINAPI IDirect3DImpl_Initialize(LPDIRECT3D iface,REFIID refiid);
80 extern HRESULT WINAPI IDirect3DImpl_EnumDevices(
81     LPDIRECT3D iface, LPD3DENUMDEVICESCALLBACK cb, LPVOID context
82 );
83 extern HRESULT WINAPI IDirect3DImpl_CreateLight(
84     LPDIRECT3D iface, LPDIRECT3DLIGHT *lplight, IUnknown *lpunk
85 );
86 extern HRESULT WINAPI IDirect3DImpl_CreateMaterial(
87     LPDIRECT3D iface, LPDIRECT3DMATERIAL *lpmaterial, IUnknown *lpunk
88 );
89 extern HRESULT WINAPI IDirect3DImpl_CreateViewport(
90     LPDIRECT3D iface, LPDIRECT3DVIEWPORT *lpviewport, IUnknown *lpunk
91 );
92 extern HRESULT WINAPI IDirect3DImpl_FindDevice(
93     LPDIRECT3D iface, LPD3DFINDDEVICESEARCH lpfinddevsrc,
94     LPD3DFINDDEVICERESULT lpfinddevrst)
95 ;
96 extern HRESULT WINAPI IDirect3D2Impl_QueryInterface(LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj);  
97 extern ULONG WINAPI IDirect3D2Impl_AddRef(LPDIRECT3D2 iface);
98 extern ULONG WINAPI IDirect3D2Impl_Release(LPDIRECT3D2 iface);
99 extern HRESULT WINAPI IDirect3D2Impl_EnumDevices(
100     LPDIRECT3D2 iface,LPD3DENUMDEVICESCALLBACK cb, LPVOID context
101 );
102 extern HRESULT WINAPI IDirect3D2Impl_CreateLight(
103     LPDIRECT3D2 iface, LPDIRECT3DLIGHT *lplight, IUnknown *lpunk
104 );
105 extern HRESULT WINAPI IDirect3D2Impl_CreateMaterial(
106     LPDIRECT3D2 iface, LPDIRECT3DMATERIAL2 *lpmaterial, IUnknown *lpunk
107 );
108 extern HRESULT WINAPI IDirect3D2Impl_CreateViewport(
109     LPDIRECT3D2 iface, LPDIRECT3DVIEWPORT2 *lpviewport, IUnknown *lpunk
110 );
111 extern HRESULT WINAPI IDirect3D2Impl_FindDevice(
112     LPDIRECT3D2 iface, LPD3DFINDDEVICESEARCH lpfinddevsrc,
113     LPD3DFINDDEVICERESULT lpfinddevrst);
114 extern HRESULT WINAPI IDirect3D2Impl_CreateDevice(
115     LPDIRECT3D2 iface, REFCLSID rguid, LPDIRECTDRAWSURFACE surface,
116     LPDIRECT3DDEVICE2 *device);
117
118 /*****************************************************************************
119  * IDirect3DLight implementation structure
120  */
121 struct IDirect3DLightImpl
122 {
123     /* IUnknown fields */
124     ICOM_VFIELD(IDirect3DLight);
125     DWORD                        ref;
126     /* IDirect3DLight fields */
127     union {
128         IDirect3DImpl*  d3d1;
129         IDirect3D2Impl* d3d2;
130     } d3d;
131     int                 type;
132   
133     D3DLIGHT2           light;
134
135     /* Chained list used for adding / removing from viewports */
136     IDirect3DLightImpl *next, *prev;
137
138     /* Activation function */
139     void (*activate)(IDirect3DLightImpl*);
140     int                 is_active;
141   
142     LPVOID              private;
143 };
144
145 /*****************************************************************************
146  * IDirect3DMaterial2 implementation structure
147  */
148 struct IDirect3DMaterial2Impl
149 {
150     /* IUnknown fields */
151     ICOM_VFIELD(IDirect3DMaterial2);
152     DWORD                            ref;
153     /* IDirect3DMaterial2 fields */
154     union {
155         IDirect3DImpl*        d3d1;
156         IDirect3D2Impl*       d3d2;
157     } d3d;
158     union {
159         IDirect3DDeviceImpl*  active_device1;
160         IDirect3DDevice2Impl* active_device2;
161     } device;
162     int                       use_d3d2;
163
164     D3DMATERIAL               mat;
165
166     void (*activate)(IDirect3DMaterial2Impl* this);
167     LPVOID                      private;
168 };
169
170 /*****************************************************************************
171  * IDirect3DTexture2 implementation structure
172  */
173 struct IDirect3DTexture2Impl
174 {
175     /* IUnknown fields */
176     ICOM_VFIELD(IDirect3DTexture2);
177     DWORD                           ref;
178     /* IDirect3DTexture2 fields */
179     void*                       D3Ddevice; /* (void *) to use the same pointer
180                                             * for both Direct3D and Direct3D2 */
181     IDirectDrawSurface4Impl*    surface;
182     LPVOID                      private;
183 };
184
185 extern HRESULT WINAPI IDirect3DTexture2Impl_QueryInterface(
186     LPDIRECT3DTEXTURE2 iface, REFIID riid, LPVOID* ppvObj
187 );
188 extern ULONG WINAPI IDirect3DTexture2Impl_AddRef(LPDIRECT3DTEXTURE2 iface);
189 extern ULONG WINAPI IDirect3DTexture2Impl_Release(LPDIRECT3DTEXTURE2 iface);
190 extern HRESULT WINAPI IDirect3DTextureImpl_GetHandle(LPDIRECT3DTEXTURE iface,
191                                                  LPDIRECT3DDEVICE lpD3DDevice,
192                                                  LPD3DTEXTUREHANDLE lpHandle)
193 ;
194 extern HRESULT WINAPI IDirect3DTextureImpl_Initialize(LPDIRECT3DTEXTURE iface,
195                                           LPDIRECT3DDEVICE lpD3DDevice,
196                                           LPDIRECTDRAWSURFACE lpSurface)
197 ;
198 extern HRESULT WINAPI IDirect3DTextureImpl_Unload(LPDIRECT3DTEXTURE iface);
199 extern HRESULT WINAPI IDirect3DTexture2Impl_GetHandle(
200     LPDIRECT3DTEXTURE2 iface, LPDIRECT3DDEVICE2 lpD3DDevice2,
201     LPD3DTEXTUREHANDLE lpHandle
202 );
203 extern HRESULT WINAPI IDirect3DTexture2Impl_PaletteChanged(
204     LPDIRECT3DTEXTURE2 iface, DWORD dwStart, DWORD dwCount
205 );
206 extern HRESULT WINAPI IDirect3DTexture2Impl_Load(
207     LPDIRECT3DTEXTURE2 iface, LPDIRECT3DTEXTURE2 lpD3DTexture2
208 );
209
210 /*****************************************************************************
211  * IDirect3DViewport2 implementation structure
212  */
213 struct IDirect3DViewport2Impl
214 {
215     /* IUnknown fields */
216     ICOM_VFIELD(IDirect3DViewport2);
217     DWORD                            ref;
218     /* IDirect3DViewport2 fields */
219     union {
220         IDirect3DImpl*        d3d1;
221         IDirect3D2Impl*       d3d2;
222     } d3d;
223     /* If this viewport is active for one device, put the device here */
224     union {
225         IDirect3DDeviceImpl*    active_device1;
226         IDirect3DDevice2Impl*   active_device2;
227     } device;
228     int                         use_d3d2;
229
230     union {
231         D3DVIEWPORT             vp1;
232         D3DVIEWPORT2            vp2;
233     } viewport;
234     int                         use_vp2;
235
236   /* Activation function */
237   void (*activate)(IDirect3DViewport2Impl*);
238   
239   /* Field used to chain viewports together */
240   IDirect3DViewport2Impl*       next;
241
242   /* Lights list */
243   IDirect3DLightImpl*           lights;
244   
245   LPVOID                        private;
246 };
247
248 extern HRESULT WINAPI IDirect3DViewport2Impl_QueryInterface(
249     LPDIRECT3DVIEWPORT2 iface, REFIID riid, LPVOID* ppvObj
250 );
251 extern ULONG WINAPI IDirect3DViewport2Impl_AddRef(LPDIRECT3DVIEWPORT2 iface)
252 ;
253 extern ULONG WINAPI IDirect3DViewport2Impl_Release(LPDIRECT3DVIEWPORT2 iface)
254 ;
255 extern HRESULT WINAPI IDirect3DViewport2Impl_Initialize(
256     LPDIRECT3DVIEWPORT2 iface, LPDIRECT3D d3d
257 );
258 extern HRESULT WINAPI IDirect3DViewport2Impl_GetViewport(
259     LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT lpvp
260 );
261 extern HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(
262     LPDIRECT3DVIEWPORT2 iface,LPD3DVIEWPORT lpvp
263 );
264 extern HRESULT WINAPI IDirect3DViewport2Impl_TransformVertices(
265     LPDIRECT3DVIEWPORT2 iface,DWORD dwVertexCount,LPD3DTRANSFORMDATA lpData,
266     DWORD dwFlags,LPDWORD lpOffScreen
267 );
268 extern HRESULT WINAPI IDirect3DViewport2Impl_LightElements(
269     LPDIRECT3DVIEWPORT2 iface,DWORD dwElementCount,LPD3DLIGHTDATA lpData
270 );
271 extern HRESULT WINAPI IDirect3DViewport2Impl_SetBackground(
272     LPDIRECT3DVIEWPORT2 iface, D3DMATERIALHANDLE hMat
273 );
274 extern HRESULT WINAPI IDirect3DViewport2Impl_GetBackground(
275     LPDIRECT3DVIEWPORT2 iface,LPD3DMATERIALHANDLE lphMat,LPBOOL lpValid
276 );
277 extern HRESULT WINAPI IDirect3DViewport2Impl_SetBackgroundDepth(
278     LPDIRECT3DVIEWPORT2 iface,LPDIRECTDRAWSURFACE lpDDSurface
279 );
280 extern HRESULT WINAPI IDirect3DViewport2Impl_GetBackgroundDepth(
281     LPDIRECT3DVIEWPORT2 iface,LPDIRECTDRAWSURFACE* lplpDDSurface,LPBOOL lpValid
282 );
283 extern HRESULT WINAPI IDirect3DViewport2Impl_Clear(
284     LPDIRECT3DVIEWPORT2 iface, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags
285 );
286 extern HRESULT WINAPI IDirect3DViewport2Impl_AddLight(
287     LPDIRECT3DVIEWPORT2 iface,LPDIRECT3DLIGHT lpLight
288 );
289 extern HRESULT WINAPI IDirect3DViewport2Impl_DeleteLight(
290     LPDIRECT3DVIEWPORT2 iface,LPDIRECT3DLIGHT lpLight
291 );
292 extern HRESULT WINAPI IDirect3DViewport2Impl_NextLight(
293     LPDIRECT3DVIEWPORT2 iface, LPDIRECT3DLIGHT lpLight,
294     LPDIRECT3DLIGHT* lplpLight, DWORD dwFlags
295 );
296 extern HRESULT WINAPI IDirect3DViewport2Impl_GetViewport2(
297     LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT2 lpViewport2
298 );
299 extern HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(
300     LPDIRECT3DVIEWPORT2 iface, LPD3DVIEWPORT2 lpViewport2
301 );
302
303 /*****************************************************************************
304  * IDirect3DExecuteBuffer implementation structure
305  */
306 struct IDirect3DExecuteBufferImpl
307 {
308     /* IUnknown fields */
309     ICOM_VFIELD(IDirect3DExecuteBuffer);
310     DWORD                                ref;
311     /* IDirect3DExecuteBuffer fields */
312     IDirect3DDeviceImpl* d3ddev;
313
314     D3DEXECUTEBUFFERDESC desc;
315     D3DEXECUTEDATA data;
316
317     /* This buffer will store the transformed vertices */
318     void* vertex_data;
319     D3DVERTEXTYPE vertex_type;
320
321     /* This flags is set to TRUE if we allocated ourselves the
322        data buffer */
323     BOOL need_free;
324
325     void (*execute)(IDirect3DExecuteBuffer* this,
326                     IDirect3DDevice* dev,
327                     IDirect3DViewport* vp);
328     LPVOID private;
329 };
330 extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc);
331
332 /*****************************************************************************
333  * IDirect3DDevice implementation structure
334  */
335 struct IDirect3DDeviceImpl
336 {
337     /* IUnknown fields */
338     ICOM_VFIELD(IDirect3DDevice);
339     DWORD                         ref;
340     /* IDirect3DDevice fields */
341     IDirect3DImpl*          d3d;
342     IDirectDrawSurfaceImpl* surface;
343
344     IDirect3DViewport2Impl*  viewport_list;
345     IDirect3DViewport2Impl*  current_viewport;
346
347     void (*set_context)(IDirect3DDeviceImpl*);
348     LPVOID              private;
349 };
350
351 /*****************************************************************************
352  * IDirect3DDevice2 implementation structure
353  */
354 struct IDirect3DDevice2Impl
355 {
356     /* IUnknown fields */
357     ICOM_VFIELD(IDirect3DDevice2);
358     DWORD                          ref;
359     /* IDirect3DDevice fields */
360     IDirect3D2Impl*         d3d;
361     IDirectDrawSurfaceImpl* surface;
362
363     IDirect3DViewport2Impl* viewport_list;
364     IDirect3DViewport2Impl* current_viewport;
365
366     void (*set_context)(IDirect3DDevice2Impl*);
367     LPVOID              private;
368 };
369 extern HRESULT WINAPI IDirect3DDevice2Impl_QueryInterface(
370     LPDIRECT3DDEVICE2 iface, REFIID riid, LPVOID* ppvObj
371 );
372 extern ULONG WINAPI IDirect3DDevice2Impl_AddRef(LPDIRECT3DDEVICE2 iface);
373 extern ULONG WINAPI IDirect3DDevice2Impl_Release(LPDIRECT3DDEVICE2 iface)
374 ;
375 extern HRESULT WINAPI IDirect3DDevice2Impl_GetCaps(
376     LPDIRECT3DDEVICE2 iface, LPD3DDEVICEDESC lpdescsoft,
377     LPD3DDEVICEDESC lpdeschard
378 );
379 extern HRESULT WINAPI IDirect3DDevice2Impl_SwapTextureHandles(
380     LPDIRECT3DDEVICE2 iface,LPDIRECT3DTEXTURE2 lptex1,LPDIRECT3DTEXTURE2 lptex2
381 );
382 extern HRESULT WINAPI IDirect3DDevice2Impl_GetStats(
383     LPDIRECT3DDEVICE2 iface, LPD3DSTATS lpstats)
384 ;
385 extern HRESULT WINAPI IDirect3DDevice2Impl_AddViewport(
386     LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp
387 );
388 extern HRESULT WINAPI IDirect3DDevice2Impl_DeleteViewport(
389     LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp)
390 ;
391 extern HRESULT WINAPI IDirect3DDevice2Impl_NextViewport(
392     LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp,
393     LPDIRECT3DVIEWPORT2* lplpvp, DWORD dwFlags
394 );
395 extern HRESULT WINAPI IDirect3DDevice2Impl_EnumTextureFormats(
396     LPDIRECT3DDEVICE2 iface, LPD3DENUMTEXTUREFORMATSCALLBACK cb, LPVOID context
397 );
398 extern HRESULT WINAPI IDirect3DDevice2Impl_BeginScene(LPDIRECT3DDEVICE2 iface);
399 extern HRESULT WINAPI IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface);
400 extern HRESULT WINAPI IDirect3DDevice2Impl_GetDirect3D(
401     LPDIRECT3DDEVICE2 iface, LPDIRECT3D2 *lpd3d2
402 );
403 extern HRESULT WINAPI IDirect3DDevice2Impl_SetCurrentViewport(
404     LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 lpvp
405 );
406 extern HRESULT WINAPI IDirect3DDevice2Impl_GetCurrentViewport(
407     LPDIRECT3DDEVICE2 iface, LPDIRECT3DVIEWPORT2 *lplpvp
408 );
409 extern HRESULT WINAPI IDirect3DDevice2Impl_SetRenderTarget(
410     LPDIRECT3DDEVICE2 iface, LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags
411 );
412 extern HRESULT WINAPI IDirect3DDevice2Impl_GetRenderTarget(
413     LPDIRECT3DDEVICE2 iface, LPDIRECTDRAWSURFACE *lplpdds
414 );
415 extern HRESULT WINAPI IDirect3DDevice2Impl_Begin(
416     LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv,
417     DWORD dwFlags
418 );
419 extern HRESULT WINAPI IDirect3DDevice2Impl_BeginIndexed(
420     LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv,
421     LPVOID lpvert, DWORD numvert, DWORD dwFlags
422 );
423 extern HRESULT WINAPI IDirect3DDevice2Impl_Vertex(
424     LPDIRECT3DDEVICE2 iface,LPVOID lpvert
425 );
426 extern HRESULT WINAPI IDirect3DDevice2Impl_Index(LPDIRECT3DDEVICE2 iface, WORD index);
427 extern HRESULT WINAPI IDirect3DDevice2Impl_End(LPDIRECT3DDEVICE2 iface,DWORD dwFlags);
428 extern HRESULT WINAPI IDirect3DDevice2Impl_GetRenderState(
429     LPDIRECT3DDEVICE2 iface, D3DRENDERSTATETYPE d3drs, LPDWORD lprstate
430 );
431 extern HRESULT WINAPI IDirect3DDevice2Impl_SetRenderState(
432     LPDIRECT3DDEVICE2 iface, D3DRENDERSTATETYPE dwRenderStateType,
433     DWORD dwRenderState
434 );
435 extern HRESULT WINAPI IDirect3DDevice2Impl_GetLightState(
436     LPDIRECT3DDEVICE2 iface, D3DLIGHTSTATETYPE d3dls, LPDWORD lplstate
437 );
438 extern HRESULT WINAPI IDirect3DDevice2Impl_SetLightState(
439     LPDIRECT3DDEVICE2 iface, D3DLIGHTSTATETYPE dwLightStateType,
440     DWORD dwLightState
441 );
442 extern HRESULT WINAPI IDirect3DDevice2Impl_SetTransform(
443     LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix
444 );
445 extern HRESULT WINAPI IDirect3DDevice2Impl_GetTransform(
446     LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix
447 );
448 extern HRESULT WINAPI IDirect3DDevice2Impl_MultiplyTransform(
449     LPDIRECT3DDEVICE2 iface, D3DTRANSFORMSTATETYPE d3dts, LPD3DMATRIX lpmatrix
450 );
451 extern HRESULT WINAPI IDirect3DDevice2Impl_DrawPrimitive(
452     LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv,
453     LPVOID lpvertex, DWORD vertcount, DWORD dwFlags
454 );
455 extern HRESULT WINAPI IDirect3DDevice2Impl_DrawIndexedPrimitive(
456     LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv,
457     LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount,
458     DWORD dwFlags
459 );
460 extern HRESULT WINAPI IDirect3DDevice2Impl_SetClipStatus(
461     LPDIRECT3DDEVICE2 iface, LPD3DCLIPSTATUS lpcs
462 );
463 extern HRESULT WINAPI IDirect3DDevice2Impl_GetClipStatus(
464     LPDIRECT3DDEVICE2 iface, LPD3DCLIPSTATUS lpcs
465 );
466 extern HRESULT WINAPI IDirect3DDeviceImpl_QueryInterface(
467     LPDIRECT3DDEVICE iface, REFIID riid, LPVOID* ppvObj
468 );
469 extern ULONG WINAPI IDirect3DDeviceImpl_AddRef(LPDIRECT3DDEVICE iface);
470 extern ULONG WINAPI IDirect3DDeviceImpl_Release(LPDIRECT3DDEVICE iface);
471 extern HRESULT WINAPI IDirect3DDeviceImpl_Initialize(
472     LPDIRECT3DDEVICE iface, LPDIRECT3D lpd3d, LPGUID lpGUID,
473     LPD3DDEVICEDESC lpd3ddvdesc
474 );
475 extern HRESULT WINAPI IDirect3DDeviceImpl_GetCaps(
476     LPDIRECT3DDEVICE iface, LPD3DDEVICEDESC lpD3DHWDevDesc,
477     LPD3DDEVICEDESC lpD3DSWDevDesc
478 );
479 extern HRESULT WINAPI IDirect3DDeviceImpl_SwapTextureHandles(
480     LPDIRECT3DDEVICE iface, LPDIRECT3DTEXTURE lpD3DTex1,
481     LPDIRECT3DTEXTURE lpD3DTex2
482 );
483 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateExecuteBuffer(
484     LPDIRECT3DDEVICE iface, LPD3DEXECUTEBUFFERDESC lpDesc,
485     LPDIRECT3DEXECUTEBUFFER *lplpDirect3DExecuteBuffer, IUnknown *pUnkOuter
486 );
487 extern HRESULT WINAPI IDirect3DDeviceImpl_GetStats(
488     LPDIRECT3DDEVICE iface, LPD3DSTATS lpD3DStats
489 );
490 extern HRESULT WINAPI IDirect3DDeviceImpl_Execute(
491     LPDIRECT3DDEVICE iface, LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,
492     LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags
493 );
494 extern HRESULT WINAPI IDirect3DDeviceImpl_AddViewport(
495     LPDIRECT3DDEVICE iface, LPDIRECT3DVIEWPORT lpvp
496 );
497 extern HRESULT WINAPI IDirect3DDeviceImpl_DeleteViewport(
498     LPDIRECT3DDEVICE iface, LPDIRECT3DVIEWPORT lpvp
499 );
500 extern HRESULT WINAPI IDirect3DDeviceImpl_NextViewport(
501     LPDIRECT3DDEVICE iface, LPDIRECT3DVIEWPORT lpvp,
502     LPDIRECT3DVIEWPORT* lplpvp, DWORD dwFlags
503 );
504 extern HRESULT WINAPI IDirect3DDeviceImpl_Pick(
505     LPDIRECT3DDEVICE iface, LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,
506     LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags, LPD3DRECT lpRect
507 );
508 extern HRESULT WINAPI IDirect3DDeviceImpl_GetPickRecords(
509     LPDIRECT3DDEVICE iface, LPDWORD lpCount, LPD3DPICKRECORD lpD3DPickRec
510 );
511 extern HRESULT WINAPI IDirect3DDeviceImpl_EnumTextureFormats(
512     LPDIRECT3DDEVICE iface,LPD3DENUMTEXTUREFORMATSCALLBACK lpd3dEnumTextureProc,
513     LPVOID lpArg
514 );
515 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateMatrix(
516     LPDIRECT3DDEVICE iface, LPD3DMATRIXHANDLE lpD3DMatHandle
517 )
518 ;
519 extern HRESULT WINAPI IDirect3DDeviceImpl_SetMatrix(
520     LPDIRECT3DDEVICE iface, D3DMATRIXHANDLE d3dMatHandle,
521     const LPD3DMATRIX lpD3DMatrix)
522 ;
523 extern HRESULT WINAPI IDirect3DDeviceImpl_GetMatrix(
524     LPDIRECT3DDEVICE iface,D3DMATRIXHANDLE D3DMatHandle,LPD3DMATRIX lpD3DMatrix
525 );
526 extern HRESULT WINAPI IDirect3DDeviceImpl_DeleteMatrix(
527     LPDIRECT3DDEVICE iface, D3DMATRIXHANDLE d3dMatHandle
528 );
529 extern HRESULT WINAPI IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface)
530 ;
531 extern HRESULT WINAPI IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface)
532 ;
533 extern HRESULT WINAPI IDirect3DDeviceImpl_GetDirect3D(
534     LPDIRECT3DDEVICE iface, LPDIRECT3D *lpDirect3D
535 );
536
537 /* All non-static functions 'exported' by various sub-objects */
538 extern LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurface4Impl* surf);
539 extern LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurface4Impl* surf);
540
541 extern LPDIRECT3DLIGHT d3dlight_create_dx3(IDirect3DImpl* d3d1);
542 extern LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2);
543
544 extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc);
545
546 extern LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1);
547 extern LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2);
548
549 extern LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1);
550 extern LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2);
551
552 extern int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDeviceImpl** device);
553 extern int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
554 extern int d3d_OpenGL(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
555 extern int is_OpenGL(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevice2Impl** device, IDirect3D2Impl* d3d);
556
557
558 extern void _dump_renderstate(D3DRENDERSTATETYPE type, DWORD value);
559
560 #define dump_mat(mat) \
561     TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
562     TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
563     TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
564     TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44);
565
566 #endif /* __GRAPHICS_WINE_D3D_PRIVATE_H */