Fixed palette handling for true/high-color X11.
[wine/multimedia.git] / graphics / ddraw_private.h
blobbf62da143cb5128c3a1eb048e479241191d34c66
1 #ifndef __GRAPHICS_WINE_DDRAW_PRIVATE_H
2 #define __GRAPHICS_WINE_DDRAW_PRIVATE_H
4 #include "ddraw.h"
5 #include "winuser.h"
7 /*****************************************************************************
8 * Predeclare the interface implementation structures
9 */
10 typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl;
11 typedef struct IDirectDrawClipperImpl IDirectDrawClipperImpl;
12 typedef struct IDirectDrawImpl IDirectDrawImpl;
13 typedef struct IDirectDraw2Impl IDirectDraw2Impl;
14 typedef struct IDirectDraw4Impl IDirectDraw4Impl;
15 typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl;
16 typedef struct IDirectDrawSurface3Impl IDirectDrawSurface2Impl;
17 typedef struct IDirectDrawSurface4Impl IDirectDrawSurface3Impl;
18 typedef struct IDirectDrawSurface4Impl IDirectDrawSurface4Impl;
19 typedef struct IDirectDrawColorControlImpl IDirectDrawColorControlImpl;
21 #include "d3d_private.h"
23 /*****************************************************************************
24 * IDirectDrawPalette implementation structure
26 struct IDirectDrawPaletteImpl
28 /* IUnknown fields */
29 ICOM_VTABLE(IDirectDrawPalette)* lpvtbl;
30 DWORD ref;
31 /* IDirectDrawPalette fields */
32 IDirectDrawImpl* ddraw;
33 Colormap cm;
34 PALETTEENTRY palents[256];
35 int installed;
36 /* This is to store the palette in 'screen format' */
37 int screen_palents[256];
40 /*****************************************************************************
41 * IDirectDrawClipper implementation structure
43 struct IDirectDrawClipperImpl
45 /* IUnknown fields */
46 ICOM_VTABLE(IDirectDrawClipper)* lpvtbl;
47 DWORD ref;
48 /* IDirectDrawClipper fields */
49 /* none */
52 /*****************************************************************************
53 * IDirectDraw implementation structure
55 struct _common_directdrawdata
57 DDPIXELFORMAT directdraw_pixelformat;
58 DDPIXELFORMAT screen_pixelformat;
59 int pixmap_depth;
60 void (*pixel_convert)(void *src, void *dst, DWORD width, DWORD height, LONG pitch, IDirectDrawPaletteImpl* palette);
61 void (*palette_convert)(LPPALETTEENTRY palent, void *screen_palette, DWORD start, DWORD count);
62 DWORD height,width; /* SetDisplayMode */
63 HWND mainWindow; /* SetCooperativeLevel */
65 /* This is for Wine's fake mainWindow.
66 We need it also in DGA mode to make some games (for example Monkey Island III work) */
67 ATOM winclass;
68 HWND window;
69 Window drawable;
70 PAINTSTRUCT ps;
71 int paintable;
74 struct _dga_directdrawdata
76 DWORD fb_width,fb_height,fb_banksize,fb_memsize;
77 void* fb_addr;
78 unsigned int vpmask;
81 struct _xlib_directdrawdata
83 #ifdef HAVE_LIBXXSHM
84 int xshm_active;
85 #endif /* defined(HAVE_LIBXXSHM) */
87 /* are these needed for anything? (draw_surf is the active surface)
88 IDirectDrawSurfaceImpl* surfs;
89 DWORD num_surfs, alloc_surfs, draw_surf; */
92 struct IDirectDrawImpl
94 /* IUnknown fields */
95 ICOM_VTABLE(IDirectDraw)* lpvtbl;
96 DWORD ref;
97 /* IDirectDraw fields */
98 struct _common_directdrawdata d;
99 union {
100 struct _xlib_directdrawdata xlib;
101 struct _dga_directdrawdata dga;
102 } e;
105 /*****************************************************************************
106 * IDirectDraw2 implementation structure
108 struct IDirectDraw2Impl
110 /* IUnknown fields */
111 ICOM_VTABLE(IDirectDraw2)* lpvtbl;
112 DWORD ref;
113 /* IDirectDraw2 fields */
114 struct _common_directdrawdata d;
115 union {
116 struct _xlib_directdrawdata xlib;
117 struct _dga_directdrawdata dga;
118 } e;
121 /*****************************************************************************
122 * IDirectDraw4 implementation structure
124 struct IDirectDraw4Impl
126 /* IUnknown fields */
127 ICOM_VTABLE(IDirectDraw4)* lpvtbl;
128 DWORD ref;
129 /* IDirectDraw4 fields */
130 struct _common_directdrawdata d;
131 union {
132 struct _xlib_directdrawdata xlib;
133 struct _dga_directdrawdata dga;
134 } e;
137 /*****************************************************************************
138 * IDirectDrawSurface implementation structure
140 struct _common_directdrawsurface
142 IDirectDrawPaletteImpl* palette;
143 IDirectDraw2Impl* ddraw;
144 IDirectDrawSurface4Impl* backbuffer;
146 DDSURFACEDESC surface_desc;
148 /* Callback for loaded textures */
149 IDirect3DTexture2Impl* texture;
150 HRESULT WINAPI (*SetColorKey_cb)(IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ;
153 struct _dga_directdrawsurface
155 DWORD fb_height;
158 struct _xlib_directdrawsurface
160 XImage *image;
161 #ifdef HAVE_LIBXXSHM
162 XShmSegmentInfo shminfo;
163 #endif
166 struct IDirectDrawSurfaceImpl
168 /* IUnknown fields */
169 ICOM_VTABLE(IDirectDrawSurface)* lpvtbl;
170 DWORD ref;
171 /* IDirectDrawSurface fields */
172 struct _common_directdrawsurface s;
173 union {
174 struct _dga_directdrawsurface dga;
175 struct _xlib_directdrawsurface xlib;
176 } t;
179 /*****************************************************************************
180 * IDirectDrawSurface2 implementation structure
182 struct IDirectDrawSurface2Impl
184 /* IUnknown fields */
185 ICOM_VTABLE(IDirectDrawSurface2)* lpvtbl;
186 DWORD ref;
187 /* IDirectDrawSurface2 fields */
188 struct _common_directdrawsurface s;
189 union {
190 struct _dga_directdrawsurface dga;
191 struct _xlib_directdrawsurface xlib;
192 } t;
195 /*****************************************************************************
196 * IDirectDrawSurface3 implementation structure
198 struct IDirectDrawSurface3Impl
200 /* IUnknown fields */
201 ICOM_VTABLE(IDirectDrawSurface3)* lpvtbl;
202 DWORD ref;
203 /* IDirectDrawSurface3 fields */
204 struct _common_directdrawsurface s;
205 union {
206 struct _dga_directdrawsurface dga;
207 struct _xlib_directdrawsurface xlib;
208 } t;
211 /*****************************************************************************
212 * IDirectDrawSurface4 implementation structure
214 struct IDirectDrawSurface4Impl
216 /* IUnknown fields */
217 ICOM_VTABLE(IDirectDrawSurface4)* lpvtbl;
218 DWORD ref;
219 /* IDirectDrawSurface4 fields */
220 struct _common_directdrawsurface s;
221 union {
222 struct _dga_directdrawsurface dga;
223 struct _xlib_directdrawsurface xlib;
224 } t;
227 /*****************************************************************************
228 * IDirectDrawColorControl implementation structure
230 struct IDirectDrawColorControlImpl
232 /* IUnknown fields */
233 ICOM_VTABLE(IDirectDrawColorControl)* lpvtbl;
234 DWORD ref;
235 /* IDirectDrawColorControl fields */
236 /* none */
240 #endif /* __GRAPHICS_WINE_DDRAW_PRIVATE_H */