Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbejy@wpi.edu>
[wine/multimedia.git] / graphics / ddraw_private.h
blob48ccb83756e4a6379b17bf6d6483bbfd569babff
1 #ifndef __GRAPHICS_WINE_DDRAW_PRIVATE_H
2 #define __GRAPHICS_WINE_DDRAW_PRIVATE_H
4 #include "ddraw.h"
6 /*****************************************************************************
7 * Predeclare the interface implementation structures
8 */
9 typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl;
10 typedef struct IDirectDrawClipperImpl IDirectDrawClipperImpl;
11 typedef struct IDirectDrawImpl IDirectDrawImpl;
12 typedef struct IDirectDraw2Impl IDirectDraw2Impl;
13 typedef struct IDirectDraw4Impl IDirectDraw4Impl;
14 typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl;
15 typedef struct IDirectDrawSurface3Impl IDirectDrawSurface2Impl;
16 typedef struct IDirectDrawSurface4Impl IDirectDrawSurface3Impl;
17 typedef struct IDirectDrawSurface4Impl IDirectDrawSurface4Impl;
18 typedef struct IDirectDrawColorControlImpl IDirectDrawColorControlImpl;
20 #include "d3d_private.h"
22 /*****************************************************************************
23 * IDirectDrawPalette implementation structure
25 struct IDirectDrawPaletteImpl
27 /* IUnknown fields */
28 ICOM_VTABLE(IDirectDrawPalette)* lpvtbl;
29 DWORD ref;
30 /* IDirectDrawPalette fields */
31 IDirectDrawImpl* ddraw;
32 Colormap cm;
33 PALETTEENTRY palents[256];
34 int installed;
35 /* This is to store the palette in 'screen format' */
36 int screen_palents[256];
39 /*****************************************************************************
40 * IDirectDrawClipper implementation structure
42 struct IDirectDrawClipperImpl
44 /* IUnknown fields */
45 ICOM_VTABLE(IDirectDrawClipper)* lpvtbl;
46 DWORD ref;
47 /* IDirectDrawClipper fields */
48 /* none */
51 /*****************************************************************************
52 * IDirectDraw implementation structure
54 struct _common_directdrawdata
56 DDPIXELFORMAT directdraw_pixelformat;
57 DDPIXELFORMAT screen_pixelformat;
58 int pixmap_depth;
59 void (*pixel_convert)(void *src, void *dst, DWORD width, DWORD height, LONG pitch, IDirectDrawPaletteImpl* palette);
60 void (*palette_convert)(LPPALETTEENTRY palent, void *screen_palette, DWORD start, DWORD count);
61 DWORD height,width; /* SetDisplayMode */
62 HWND mainWindow; /* SetCooperativeLevel */
64 /* This is for Wine's fake mainWindow.
65 We need it also in DGA mode to make some games (for example Monkey Island III work) */
66 ATOM winclass;
67 HWND window;
68 Window drawable;
69 PAINTSTRUCT ps;
70 int paintable;
73 struct _dga_directdrawdata
75 DWORD fb_width,fb_height,fb_banksize,fb_memsize;
76 void* fb_addr;
77 unsigned int vpmask;
80 struct _xlib_directdrawdata
82 #ifdef HAVE_LIBXXSHM
83 int xshm_active;
84 #endif /* defined(HAVE_LIBXXSHM) */
86 /* are these needed for anything? (draw_surf is the active surface)
87 IDirectDrawSurfaceImpl* surfs;
88 DWORD num_surfs, alloc_surfs, draw_surf; */
91 struct IDirectDrawImpl
93 /* IUnknown fields */
94 ICOM_VTABLE(IDirectDraw)* lpvtbl;
95 DWORD ref;
96 /* IDirectDraw fields */
97 struct _common_directdrawdata d;
98 union {
99 struct _xlib_directdrawdata xlib;
100 struct _dga_directdrawdata dga;
101 } e;
104 /*****************************************************************************
105 * IDirectDraw2 implementation structure
107 struct IDirectDraw2Impl
109 /* IUnknown fields */
110 ICOM_VTABLE(IDirectDraw2)* lpvtbl;
111 DWORD ref;
112 /* IDirectDraw2 fields */
113 struct _common_directdrawdata d;
114 union {
115 struct _xlib_directdrawdata xlib;
116 struct _dga_directdrawdata dga;
117 } e;
120 /*****************************************************************************
121 * IDirectDraw4 implementation structure
123 struct IDirectDraw4Impl
125 /* IUnknown fields */
126 ICOM_VTABLE(IDirectDraw4)* lpvtbl;
127 DWORD ref;
128 /* IDirectDraw4 fields */
129 struct _common_directdrawdata d;
130 union {
131 struct _xlib_directdrawdata xlib;
132 struct _dga_directdrawdata dga;
133 } e;
136 /*****************************************************************************
137 * IDirectDrawSurface implementation structure
139 struct _common_directdrawsurface
141 IDirectDrawPaletteImpl* palette;
142 IDirectDraw2Impl* ddraw;
143 IDirectDrawSurface4Impl* backbuffer;
145 DDSURFACEDESC surface_desc;
147 /* Callback for loaded textures */
148 IDirect3DTexture2Impl* texture;
149 HRESULT WINAPI (*SetColorKey_cb)(IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ;
152 struct _dga_directdrawsurface
154 DWORD fb_height;
157 struct _xlib_directdrawsurface
159 XImage *image;
160 #ifdef HAVE_LIBXXSHM
161 XShmSegmentInfo shminfo;
162 #endif
165 struct IDirectDrawSurfaceImpl
167 /* IUnknown fields */
168 ICOM_VTABLE(IDirectDrawSurface)* lpvtbl;
169 DWORD ref;
170 /* IDirectDrawSurface fields */
171 struct _common_directdrawsurface s;
172 union {
173 struct _dga_directdrawsurface dga;
174 struct _xlib_directdrawsurface xlib;
175 } t;
178 /*****************************************************************************
179 * IDirectDrawSurface2 implementation structure
181 struct IDirectDrawSurface2Impl
183 /* IUnknown fields */
184 ICOM_VTABLE(IDirectDrawSurface2)* lpvtbl;
185 DWORD ref;
186 /* IDirectDrawSurface2 fields */
187 struct _common_directdrawsurface s;
188 union {
189 struct _dga_directdrawsurface dga;
190 struct _xlib_directdrawsurface xlib;
191 } t;
194 /*****************************************************************************
195 * IDirectDrawSurface3 implementation structure
197 struct IDirectDrawSurface3Impl
199 /* IUnknown fields */
200 ICOM_VTABLE(IDirectDrawSurface3)* lpvtbl;
201 DWORD ref;
202 /* IDirectDrawSurface3 fields */
203 struct _common_directdrawsurface s;
204 union {
205 struct _dga_directdrawsurface dga;
206 struct _xlib_directdrawsurface xlib;
207 } t;
210 /*****************************************************************************
211 * IDirectDrawSurface4 implementation structure
213 struct IDirectDrawSurface4Impl
215 /* IUnknown fields */
216 ICOM_VTABLE(IDirectDrawSurface4)* lpvtbl;
217 DWORD ref;
218 /* IDirectDrawSurface4 fields */
219 struct _common_directdrawsurface s;
220 union {
221 struct _dga_directdrawsurface dga;
222 struct _xlib_directdrawsurface xlib;
223 } t;
226 /*****************************************************************************
227 * IDirectDrawColorControl implementation structure
229 struct IDirectDrawColorControlImpl
231 /* IUnknown fields */
232 ICOM_VTABLE(IDirectDrawColorControl)* lpvtbl;
233 DWORD ref;
234 /* IDirectDrawColorControl fields */
235 /* none */
239 #endif /* __GRAPHICS_WINE_DDRAW_PRIVATE_H */