1 #ifndef __GRAPHICS_WINE_DDRAW_PRIVATE_H
2 #define __GRAPHICS_WINE_DDRAW_PRIVATE_H
6 #ifdef HAVE_LIBXXF86DGA2
7 #include "ts_xf86dga2.h"
8 #endif /* defined(HAVE_LIBXXF86DGA2) */
13 /*****************************************************************************
14 * Predeclare the interface implementation structures
16 typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl
;
17 typedef struct IDirectDrawClipperImpl IDirectDrawClipperImpl
;
18 typedef struct IDirectDrawImpl IDirectDrawImpl
;
19 typedef struct IDirectDraw2Impl IDirectDraw2Impl
;
20 typedef struct IDirectDraw4Impl IDirectDraw4Impl
;
21 typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl
;
22 typedef struct IDirectDrawSurface3Impl IDirectDrawSurface2Impl
;
23 typedef struct IDirectDrawSurface4Impl IDirectDrawSurface3Impl
;
24 typedef struct IDirectDrawSurface4Impl IDirectDrawSurface4Impl
;
25 typedef struct IDirectDrawColorControlImpl IDirectDrawColorControlImpl
;
27 #include "d3d_private.h"
29 /*****************************************************************************
30 * IDirectDrawPalette implementation structure
32 struct IDirectDrawPaletteImpl
35 ICOM_VFIELD(IDirectDrawPalette
);
37 /* IDirectDrawPalette fields */
38 IDirectDrawImpl
* ddraw
;
40 PALETTEENTRY palents
[256];
42 /* This is to store the palette in 'screen format' */
43 int screen_palents
[256];
46 /*****************************************************************************
47 * IDirectDrawClipper implementation structure
49 struct IDirectDrawClipperImpl
52 ICOM_VFIELD(IDirectDrawClipper
);
55 /* IDirectDrawClipper fields */
59 /*****************************************************************************
60 * IDirectDraw implementation structure
62 struct _common_directdrawdata
64 DDPIXELFORMAT directdraw_pixelformat
;
65 DDPIXELFORMAT screen_pixelformat
;
67 void (*pixel_convert
)(void *src
, void *dst
, DWORD width
, DWORD height
, LONG pitch
, IDirectDrawPaletteImpl
* palette
);
68 void (*palette_convert
)(LPPALETTEENTRY palent
, void *screen_palette
, DWORD start
, DWORD count
);
69 DWORD height
,width
; /* SetDisplayMode */
70 HWND mainWindow
; /* SetCooperativeLevel */
72 /* This is for Wine's fake mainWindow.
73 We need it also in DGA mode to make some games (for example Monkey Island III work) */
81 struct _dga_directdrawdata
83 DWORD fb_width
,fb_height
,fb_memsize
;
86 #ifdef HAVE_LIBXXF86DGA2
91 #endif /* define(HAVE_LIBXXF86DGA2) */
94 struct _xlib_directdrawdata
97 int xshm_active
, xshm_compl
;
98 #endif /* defined(HAVE_LIBXXSHM) */
100 /* are these needed for anything? (draw_surf is the active surface)
101 IDirectDrawSurfaceImpl* surfs;
102 DWORD num_surfs, alloc_surfs, draw_surf; */
105 struct IDirectDrawImpl
107 /* IUnknown fields */
108 ICOM_VFIELD(IDirectDraw
);
110 /* IDirectDraw fields */
111 struct _common_directdrawdata d
;
113 struct _xlib_directdrawdata xlib
;
114 struct _dga_directdrawdata dga
;
118 /*****************************************************************************
119 * IDirectDraw2 implementation structure
121 struct IDirectDraw2Impl
123 /* IUnknown fields */
124 ICOM_VFIELD(IDirectDraw2
);
126 /* IDirectDraw2 fields */
127 struct _common_directdrawdata d
;
129 struct _xlib_directdrawdata xlib
;
130 struct _dga_directdrawdata dga
;
134 /*****************************************************************************
135 * IDirectDraw4 implementation structure
137 struct IDirectDraw4Impl
139 /* IUnknown fields */
140 ICOM_VFIELD(IDirectDraw4
);
142 /* IDirectDraw4 fields */
143 struct _common_directdrawdata d
;
145 struct _xlib_directdrawdata xlib
;
146 struct _dga_directdrawdata dga
;
150 /*****************************************************************************
151 * IDirectDrawSurface implementation structure
153 struct _common_directdrawsurface
155 IDirectDrawPaletteImpl
* palette
;
156 IDirectDraw2Impl
* ddraw
;
158 struct _surface_chain
*chain
;
160 DDSURFACEDESC surface_desc
;
162 /* For Get / Release DC methods */
168 /* Callback for loaded textures */
169 IDirect3DTexture2Impl
* texture
;
170 HRESULT
WINAPI (*SetColorKey_cb
)(IDirect3DTexture2Impl
*texture
, DWORD dwFlags
, LPDDCOLORKEY ckey
) ;
172 /* Storage for attached device (void * as it can be either a Device or a Device2) */
175 LPDIRECTDRAWCLIPPER lpClipper
;
178 struct _dga_directdrawsurface
183 struct _xlib_directdrawsurface
187 XShmSegmentInfo shminfo
;
191 struct IDirectDrawSurfaceImpl
193 /* IUnknown fields */
194 ICOM_VFIELD(IDirectDrawSurface
);
196 /* IDirectDrawSurface fields */
197 struct _common_directdrawsurface s
;
199 struct _dga_directdrawsurface dga
;
200 struct _xlib_directdrawsurface xlib
;
204 /*****************************************************************************
205 * IDirectDrawSurface2 implementation structure
207 struct IDirectDrawSurface2Impl
209 /* IUnknown fields */
210 ICOM_VFIELD(IDirectDrawSurface2
);
212 /* IDirectDrawSurface2 fields */
213 struct _common_directdrawsurface s
;
215 struct _dga_directdrawsurface dga
;
216 struct _xlib_directdrawsurface xlib
;
220 /*****************************************************************************
221 * IDirectDrawSurface3 implementation structure
223 struct IDirectDrawSurface3Impl
225 /* IUnknown fields */
226 ICOM_VFIELD(IDirectDrawSurface3
);
228 /* IDirectDrawSurface3 fields */
229 struct _common_directdrawsurface s
;
231 struct _dga_directdrawsurface dga
;
232 struct _xlib_directdrawsurface xlib
;
236 /*****************************************************************************
237 * IDirectDrawSurface4 implementation structure
239 struct IDirectDrawSurface4Impl
241 /* IUnknown fields */
242 ICOM_VFIELD(IDirectDrawSurface4
);
245 /* IDirectDrawSurface4 fields */
246 struct _common_directdrawsurface s
;
248 struct _dga_directdrawsurface dga
;
249 struct _xlib_directdrawsurface xlib
;
253 struct _surface_chain
{
254 IDirectDrawSurface4Impl
**surfaces
;
258 /*****************************************************************************
259 * IDirectDrawColorControl implementation structure
261 struct IDirectDrawColorControlImpl
263 /* IUnknown fields */
264 ICOM_VFIELD(IDirectDrawColorControl
);
266 /* IDirectDrawColorControl fields */
271 #endif /* __GRAPHICS_WINE_DDRAW_PRIVATE_H */