2 * Copyright 2000-2001 TransGaming Technologies Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
20 #define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
22 /* MAY NOT CONTAIN X11 or DGA specific includes/defines/structs! */
34 #include "ddcomimpl.h"
37 /* XXX Put this somewhere proper. */
38 #define DD_STRUCT_INIT(x) \
40 memset((x), 0, sizeof(*(x))); \
41 (x)->dwSize = sizeof(*x); \
44 #define DD_STRUCT_COPY_BYSIZE(to,from) \
46 DWORD __size = (to)->dwSize; \
47 DWORD __copysize = __size; \
48 DWORD __resetsize = __size; \
49 if (__resetsize > sizeof(*to)) \
50 __resetsize = sizeof(*to); \
51 memset(to,0,__resetsize); \
52 if ((from)->dwSize < __size) \
53 __copysize = (from)->dwSize; \
54 memcpy(to,from,__copysize); \
55 (to)->dwSize = __size;/*restore size*/ \
58 #define MAKE_FOURCC(a,b,c,d) ((a << 0) | (b << 8) | (c << 16) | (d << 24))
60 /*****************************************************************************
61 * IDirectDraw implementation structure
64 typedef struct IDirectDrawImpl IDirectDrawImpl;
65 typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl;
66 typedef struct IDirectDrawClipperImpl IDirectDrawClipperImpl;
67 typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl;
68 typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
70 typedef void (*pixel_convert_func)(void *src, void *dst, DWORD width,
71 DWORD height, LONG pitch,
72 IDirectDrawPaletteImpl *palette);
74 typedef void (*palette_convert_func)(LPPALETTEENTRY palent,
75 void *screen_palette, DWORD start,
78 struct IDirectDrawImpl
80 ICOM_VFIELD_MULTI(IDirectDraw7);
81 ICOM_VFIELD_MULTI(IDirectDraw4);
82 ICOM_VFIELD_MULTI(IDirectDraw2);
83 ICOM_VFIELD_MULTI(IDirectDraw);
84 ICOM_VFIELD_MULTI(IDirect3D7);
85 ICOM_VFIELD_MULTI(IDirect3D3);
86 ICOM_VFIELD_MULTI(IDirect3D2);
87 ICOM_VFIELD_MULTI(IDirect3D);
91 /* TRUE if created via DirectDrawCreateEx or CoCreateInstance,
92 * FALSE if created via DirectDrawCreate. */
95 /* Linked list of surfaces, joined by next_ddraw in IDirectSurfaceImpl. */
96 IDirectDrawSurfaceImpl* surfaces;
97 /* Linked list of palettes, joined by next_ddraw. */
98 IDirectDrawPaletteImpl* palettes;
99 /* Linked list of clippers, joined by next_ddraw. */
100 IDirectDrawClipperImpl* clippers;
102 IDirectDrawSurfaceImpl* primary_surface;
104 DDRAWI_DIRECTDRAW_LCL local;
108 DWORD cooperative_level;
109 WNDPROC original_wndproc;
113 DDPIXELFORMAT pixelformat;
116 /* Should each of these go into some structure? */
117 DWORD orig_width, orig_height;
119 DDPIXELFORMAT orig_pixelformat;
121 /* Called when the refcount goes to 0. */
122 void (*final_release)(IDirectDrawImpl *This);
124 HRESULT (*set_exclusive_mode)(IDirectDrawImpl *This, DWORD dwExcl);
126 HRESULT (*create_palette)(IDirectDrawImpl* This, DWORD dwFlags,
127 LPDIRECTDRAWPALETTE* ppPalette,
128 LPUNKNOWN pUnkOuter);
130 /* Surface creation functions. For all of these, pOuter == NULL. */
132 /* Do not create any backbuffers or the flipping chain. */
133 HRESULT (*create_primary)(IDirectDrawImpl* This,
134 const DDSURFACEDESC2* pDDSD,
135 LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
137 /* Primary may be NULL if we are creating an unattached backbuffer. */
138 HRESULT (*create_backbuffer)(IDirectDrawImpl* This,
139 const DDSURFACEDESC2* pDDSD,
140 LPDIRECTDRAWSURFACE7* ppSurf,
142 IDirectDrawSurfaceImpl* primary);
144 /* shiny happy offscreenplain surfaces */
145 HRESULT (*create_offscreen)(IDirectDrawImpl* This,
146 const DDSURFACEDESC2* pDDSD,
147 LPDIRECTDRAWSURFACE7* ppSurf,
150 /* dwMipMapLevel is specified as per OpenGL. (i.e. 0 is base) */
151 HRESULT (*create_texture)(IDirectDrawImpl* This,
152 const DDSURFACEDESC2* pDDSD,
153 LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter,
154 DWORD dwMipMapLevel);
156 HRESULT (*create_zbuffer)(IDirectDrawImpl* This,
157 const DDSURFACEDESC2* pDDSD,
158 LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
162 /* Everything below here is still questionable. */
164 DDPIXELFORMAT screen_pixelformat;
167 pixel_convert_func pixel_convert;
168 palette_convert_func palette_convert;
170 /* Use to fool some too strict games */
171 INT32 (*allocate_memory)(IDirectDrawImpl *This, DWORD mem);
172 void (*free_memory)(IDirectDrawImpl *This, DWORD mem);
173 DWORD total_vidmem, available_vidmem;
175 /* IDirect3D fields */
178 /* Used as a callback function to create a texture */
179 HRESULT (*d3d_create_texture)(IDirectDrawImpl *d3d, IDirectDrawSurfaceImpl *tex, BOOLEAN at_creation, IDirectDrawSurfaceImpl *main);
181 /* Used as a callback for Devices to tell to the D3D object it's been created */
182 HRESULT (*d3d_added_device)(IDirectDrawImpl *d3d, IDirect3DDeviceImpl *device);
183 HRESULT (*d3d_removed_device)(IDirectDrawImpl *d3d, IDirect3DDeviceImpl *device);
185 /* This is needed for delayed texture creation and Z buffer blits */
186 IDirect3DDeviceImpl *current_device;
188 /* This is for the fake mainWindow */
194 /*****************************************************************************
195 * IDirectDrawPalette implementation structure
197 struct IDirectDrawPaletteImpl
199 /* IUnknown fields */
200 ICOM_VFIELD_MULTI(IDirectDrawPalette);
203 DDRAWI_DDRAWPALETTE_LCL local;
204 DDRAWI_DDRAWPALETTE_GBL global;
206 /* IDirectDrawPalette fields */
208 WORD palVersion, palNumEntries; /* LOGPALETTE */
209 PALETTEENTRY palents[256];
210 /* This is to store the palette in 'screen format' */
211 int screen_palents[256];
213 VOID (*final_release)(IDirectDrawPaletteImpl* This);
215 IDirectDrawImpl* ddraw_owner;
216 IDirectDrawPaletteImpl* prev_ddraw;
217 IDirectDrawPaletteImpl* next_ddraw;
222 /*****************************************************************************
223 * IDirectDrawClipper implementation structure
225 struct IDirectDrawClipperImpl
227 /* IUnknown fields */
228 ICOM_VFIELD_MULTI(IDirectDrawClipper);
231 /* IDirectDrawClipper fields */
234 IDirectDrawImpl* ddraw_owner;
235 IDirectDrawClipperImpl* prev_ddraw;
236 IDirectDrawClipperImpl* next_ddraw;
239 /*****************************************************************************
240 * IDirectDrawSurface implementation structure
243 struct IDirectDrawSurfaceImpl
245 /* IUnknown fields */
246 ICOM_VFIELD_MULTI(IDirectDrawSurface7);
247 ICOM_VFIELD_MULTI(IDirectDrawSurface3);
248 ICOM_VFIELD_MULTI(IDirectDrawGammaControl);
249 ICOM_VFIELD_MULTI(IDirect3DTexture2);
250 ICOM_VFIELD_MULTI(IDirect3DTexture);
253 struct IDirectDrawSurfaceImpl* attached; /* attached surfaces */
255 struct IDirectDrawSurfaceImpl* next_ddraw; /* ddraw surface chain */
256 struct IDirectDrawSurfaceImpl* prev_ddraw;
257 struct IDirectDrawSurfaceImpl* next_attached; /* attached surface chain */
258 struct IDirectDrawSurfaceImpl* prev_attached;
260 IDirectDrawImpl* ddraw_owner;
261 IDirectDrawSurfaceImpl* surface_owner;
263 IDirectDrawPaletteImpl* palette; /* strong ref */
264 IDirectDrawClipperImpl* clipper; /* strong ref */
266 DDRAWI_DDRAWSURFACE_LCL local;
267 DDRAWI_DDRAWSURFACE_MORE more;
268 /* FIXME: since Flip should swap the GBL structures, they should
269 * probably not be embedded into the IDirectDrawSurfaceImpl structure... */
270 LPDDRAWI_DDRAWSURFACE_GBL_MORE gmore;
271 DDRAWI_DDRAWSURFACE_GBL global;
272 DDRAWI_DDRAWSURFACE_GBL_MORE global_more;
274 DDSURFACEDESC2 surface_desc;
282 HRESULT (*duplicate_surface)(IDirectDrawSurfaceImpl* src,
283 LPDIRECTDRAWSURFACE7* dst);
284 void (*final_release)(IDirectDrawSurfaceImpl *This);
285 HRESULT (*late_allocate)(IDirectDrawSurfaceImpl *This);
286 BOOL (*attach)(IDirectDrawSurfaceImpl *This, IDirectDrawSurfaceImpl *to);
287 BOOL (*detach)(IDirectDrawSurfaceImpl *This);
288 void (*lock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect, DWORD dwFlags);
289 void (*unlock_update)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
290 void (*lose_surface)(IDirectDrawSurfaceImpl* This);
291 BOOL (*flip_data)(IDirectDrawSurfaceImpl* front,
292 IDirectDrawSurfaceImpl* back,
294 void (*flip_update)(IDirectDrawSurfaceImpl* front, DWORD dwFlags);
295 HRESULT (*get_dc)(IDirectDrawSurfaceImpl* This, HDC* phDC);
296 HRESULT (*release_dc)(IDirectDrawSurfaceImpl* This, HDC hDC);
297 void (*set_palette)(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* pal);
298 void (*update_palette)(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* pal,
299 DWORD dwStart, DWORD dwCount, LPPALETTEENTRY palent);
300 HWND (*get_display_window)(IDirectDrawSurfaceImpl *This);
301 HRESULT (*get_gamma_ramp)(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp);
302 HRESULT (*set_gamma_ramp)(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp);
304 struct PrivateData* private_data;
311 DWORD uniqueness_value;
315 /* Everything below here is dodgy. */
316 /* For Direct3D use */
317 LPVOID aux_ctx, aux_data;
318 void (*aux_release)(LPVOID ctx, LPVOID data);
319 BOOL (*aux_flip)(LPVOID ctx, LPVOID data);
320 void (*aux_unlock)(LPVOID ctx, LPVOID data, LPRECT lpRect);
321 HRESULT (*aux_blt)(struct IDirectDrawSurfaceImpl *This, LPRECT rdst, LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx);
322 HRESULT (*aux_bltfast)(struct IDirectDrawSurfaceImpl *This, DWORD dstx, DWORD dsty, LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD trans);
323 HRESULT (*aux_setcolorkey_cb)(struct IDirectDrawSurfaceImpl *texture, DWORD dwFlags, LPDDCOLORKEY ckey );
324 /* This is to get the D3DDevice object associated to this surface */
325 struct IDirect3DDeviceImpl *d3ddevice;
326 /* This is for texture */
327 IDirectDrawSurfaceImpl *mip_main;
330 void (*lock_update_prev)(IDirectDrawSurfaceImpl* This, LPCRECT pRect, DWORD dwFlags);
331 void (*unlock_update_prev)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
332 BOOLEAN (*get_dirty_status)(IDirectDrawSurfaceImpl* This, LPCRECT pRect);
335 /*****************************************************************************
336 * Driver initialisation functions.
338 BOOL DDRAW_HAL_Init(HINSTANCE, DWORD, LPVOID);
339 BOOL DDRAW_User_Init(HINSTANCE, DWORD, LPVOID);
342 const DDDEVICEIDENTIFIER2* info;
343 int preference; /* how good we are. dga might get 100, xlib 50*/
344 HRESULT (*create)(const GUID*, LPDIRECTDRAW7*, LPUNKNOWN, BOOL ex);
346 /* For IDirectDraw7::Initialize. */
347 HRESULT (*init)(IDirectDrawImpl *, const GUID*);
350 void DDRAW_register_driver(const ddraw_driver*);
352 const ddraw_driver* DDRAW_FindDriver(const GUID* guid);
354 /******************************************************************************
358 /* Get DDSCAPS of surface (shortcutmacro) */
359 #define SDDSCAPS(iface) ((iface)->s.surface_desc.ddsCaps.dwCaps)
360 /* Get the number of bytes per pixel for a given surface */
361 #define PFGET_BPP(pf) (pf.dwFlags&DDPF_PALETTEINDEXED8?1:((pf.u1.dwRGBBitCount+7)/8))
362 #define GET_BPP(desc) PFGET_BPP(desc.u4.ddpfPixelFormat)
364 LONG DDRAW_width_bpp_to_pitch(DWORD width, DWORD bpp);
367 unsigned short bpp,depth;
368 unsigned int rmask,gmask,bmask;
372 void (*pixel_convert)(void *src, void *dst, DWORD width, DWORD height, LONG pitch, IDirectDrawPaletteImpl* palette);
373 void (*palette_convert)(LPPALETTEENTRY palent, void *screen_palette, DWORD start, DWORD count);
377 ConvertMode screen, dest;
381 extern Convert ModeEmulations[8];
382 extern int _common_depth_to_pixelformat(DWORD depth,LPDIRECTDRAW ddraw);
383 extern BOOL opengl_initialized;
384 extern BOOL s3tc_initialized;
386 typedef void (*FUNC_FETCH_2D_TEXEL_RGBA_DXT1)(int srcRowStride, const BYTE *pixdata, int i, int j, void *texel);
387 typedef void (*FUNC_FETCH_2D_TEXEL_RGBA_DXT3)(int srcRowStride, const BYTE *pixdata, int i, int j, void *texel);
388 typedef void (*FUNC_FETCH_2D_TEXEL_RGBA_DXT5)(int srcRowStride, const BYTE *pixdata, int i, int j, void *texel);
390 extern FUNC_FETCH_2D_TEXEL_RGBA_DXT1 fetch_2d_texel_rgba_dxt1;
391 extern FUNC_FETCH_2D_TEXEL_RGBA_DXT3 fetch_2d_texel_rgba_dxt3;
392 extern FUNC_FETCH_2D_TEXEL_RGBA_DXT5 fetch_2d_texel_rgba_dxt5;
394 /******************************************************************************
395 * Structure conversion (for thunks)
397 void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS* pIn, DDSCAPS2* pOut);
398 void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2* pIn,
399 DDDEVICEIDENTIFIER* pOut);
401 /******************************************************************************
402 * Debugging / Flags output functions
404 extern void DDRAW_dump_DDBLTFX(DWORD flagmask);
405 extern void DDRAW_dump_DDBLTFAST(DWORD flagmask);
406 extern void DDRAW_dump_DDBLT(DWORD flagmask);
407 extern void DDRAW_dump_DDSCAPS(const DDSCAPS *in);
408 extern void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in);
409 extern void DDRAW_dump_pixelformat_flag(DWORD flagmask);
410 extern void DDRAW_dump_paletteformat(DWORD dwFlags);
411 extern void DDRAW_dump_pixelformat(const DDPIXELFORMAT *in);
412 extern void DDRAW_dump_colorkeyflag(DWORD ck);
413 extern void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd);
414 extern void DDRAW_dump_cooperativelevel(DWORD cooplevel);
415 extern void DDRAW_dump_lockflag(DWORD lockflag);
416 extern void DDRAW_dump_DDCOLORKEY(const DDCOLORKEY *in);
417 extern void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps);
418 extern void DDRAW_dump_surface_to_disk(IDirectDrawSurfaceImpl *surface, FILE *f, int scale) ;
420 /* Used for generic dumping */
427 #define FE(x) { x, #x }
433 void (*func)(const void *);
437 #define DDRAW_dump_flags(flags,names,num_names) DDRAW_dump_flags_(flags, names, num_names, 1)
438 #define ME(x,f,e) { x, #x, (void (*)(const void *))(f), offsetof(STRUCT, e) }
440 extern void DDRAW_dump_flags_(DWORD flags, const flag_info* names, size_t num_names, int newline);
441 extern void DDRAW_dump_members(DWORD flags, const void* data, const member_info* mems, size_t num_mems);
443 void DirectDrawSurface_RegisterClass(void);
444 void DirectDrawSurface_UnregisterClass(void);
446 extern const IDirectDrawSurface3Vtbl DDRAW_IDDS3_Thunk_VTable;
448 /*****************************************************************************
449 * IDirectDrawClipper declarations
451 HRESULT DDRAW_CreateClipper(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppObj);
452 void Main_DirectDrawClipper_ForceDestroy(IDirectDrawClipperImpl* This);
455 Main_DirectDrawClipper_SetHwnd(LPDIRECTDRAWCLIPPER iface, DWORD dwFlags,
457 ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface);
459 Main_DirectDrawClipper_GetClipList(LPDIRECTDRAWCLIPPER iface, LPRECT lpRect,
460 LPRGNDATA lpClipList, LPDWORD lpdwSize);
462 Main_DirectDrawClipper_SetClipList(LPDIRECTDRAWCLIPPER iface,LPRGNDATA lprgn,
465 Main_DirectDrawClipper_QueryInterface(LPDIRECTDRAWCLIPPER iface, REFIID riid,
467 ULONG WINAPI Main_DirectDrawClipper_AddRef( LPDIRECTDRAWCLIPPER iface );
469 Main_DirectDrawClipper_GetHWnd(LPDIRECTDRAWCLIPPER iface, HWND* hWndPtr);
471 Main_DirectDrawClipper_Initialize(LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD,
474 Main_DirectDrawClipper_IsClipListChanged(LPDIRECTDRAWCLIPPER iface,
477 /*****************************************************************************
478 * IDirectDrawPalette MAIN declarations
480 HRESULT Main_DirectDrawPalette_Construct(IDirectDrawPaletteImpl* This,
481 IDirectDrawImpl* pDD, DWORD dwFlags);
482 void Main_DirectDrawPalette_final_release(IDirectDrawPaletteImpl* This);
484 HRESULT Main_DirectDrawPalette_Create(IDirectDrawImpl* pDD, DWORD dwFlags,
485 LPDIRECTDRAWPALETTE* ppPalette,
486 LPUNKNOWN pUnkOuter);
487 void Main_DirectDrawPalette_ForceDestroy(IDirectDrawPaletteImpl* This);
489 DWORD Main_DirectDrawPalette_Size(DWORD dwFlags);
492 Main_DirectDrawPalette_GetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags,
493 DWORD dwStart, DWORD dwCount,
494 LPPALETTEENTRY palent);
496 Main_DirectDrawPalette_SetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags,
497 DWORD dwStart, DWORD dwCount,
498 LPPALETTEENTRY palent);
500 Main_DirectDrawPalette_Release(LPDIRECTDRAWPALETTE iface);
501 ULONG WINAPI Main_DirectDrawPalette_AddRef(LPDIRECTDRAWPALETTE iface);
503 Main_DirectDrawPalette_Initialize(LPDIRECTDRAWPALETTE iface,
504 LPDIRECTDRAW ddraw, DWORD dwFlags,
505 LPPALETTEENTRY palent);
507 Main_DirectDrawPalette_GetCaps(LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps);
509 Main_DirectDrawPalette_QueryInterface(LPDIRECTDRAWPALETTE iface,
510 REFIID refiid, LPVOID *obj);
512 /*****************************************************************************
513 * IDirectDrawPalette HAL declarations
515 HRESULT HAL_DirectDrawPalette_Construct(IDirectDrawPaletteImpl* This,
516 IDirectDrawImpl* pDD, DWORD dwFlags);
517 void HAL_DirectDrawPalette_final_release(IDirectDrawPaletteImpl* This);
519 HRESULT HAL_DirectDrawPalette_Create(IDirectDrawImpl* pDD, DWORD dwFlags,
520 LPDIRECTDRAWPALETTE* ppPalette,
521 LPUNKNOWN pUnkOuter);
524 HAL_DirectDrawPalette_SetEntries(LPDIRECTDRAWPALETTE iface, DWORD dwFlags,
525 DWORD dwStart, DWORD dwCount,
526 LPPALETTEENTRY palent);
528 /*****************************************************************************
529 * IDirectDraw MAIN declarations
531 /* internal virtual functions */
532 void Main_DirectDraw_final_release(IDirectDrawImpl* This);
533 HRESULT Main_create_offscreen(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
534 LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
535 HRESULT Main_create_texture(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
536 LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter,
537 DWORD dwMipMapLevel);
538 HRESULT Main_create_zbuffer(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
539 LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
541 /* internal functions */
542 HRESULT Main_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex);
543 void Main_DirectDraw_AddSurface(IDirectDrawImpl* This,
544 IDirectDrawSurfaceImpl* surface);
545 void Main_DirectDraw_RemoveSurface(IDirectDrawImpl* This,
546 IDirectDrawSurfaceImpl* surface);
547 void Main_DirectDraw_AddClipper(IDirectDrawImpl* This,
548 IDirectDrawClipperImpl* clipper);
549 void Main_DirectDraw_RemoveClipper(IDirectDrawImpl* This,
550 IDirectDrawClipperImpl* clipper);
551 void Main_DirectDraw_AddPalette(IDirectDrawImpl* This,
552 IDirectDrawPaletteImpl* palette);
553 void Main_DirectDraw_RemovePalette(IDirectDrawImpl* This,
554 IDirectDrawPaletteImpl* palette);
556 /* interface functions */
557 ULONG WINAPI Main_DirectDraw_AddRef(LPDIRECTDRAW7 iface);
558 ULONG WINAPI Main_DirectDraw_Release(LPDIRECTDRAW7 iface);
559 HRESULT WINAPI Main_DirectDraw_QueryInterface(LPDIRECTDRAW7 iface,
560 REFIID refiid,LPVOID *obj);
561 HRESULT WINAPI Main_DirectDraw_Compact(LPDIRECTDRAW7 iface);
562 HRESULT WINAPI Main_DirectDraw_CreateClipper(LPDIRECTDRAW7 iface,
564 LPDIRECTDRAWCLIPPER *ppClipper,
565 IUnknown *pUnkOuter);
567 Main_DirectDraw_CreatePalette(LPDIRECTDRAW7 iface, DWORD dwFlags,
568 LPPALETTEENTRY palent,
569 LPDIRECTDRAWPALETTE* ppPalette,
572 Main_DirectDraw_CreateSurface(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
573 LPDIRECTDRAWSURFACE7 *ppSurf,
574 IUnknown *pUnkOuter);
576 Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7 iface, LPDIRECTDRAWSURFACE7 src,
577 LPDIRECTDRAWSURFACE7* dst);
579 Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,
580 LPDDSURFACEDESC2 lpDDSD2, LPVOID context,
581 LPDDENUMSURFACESCALLBACK7 callback);
583 Main_DirectDraw_EvaluateMode(LPDIRECTDRAW7 iface,DWORD a,DWORD* b);
584 HRESULT WINAPI Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface);
586 Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
589 Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7 iface, LPDWORD pNumCodes,
592 Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface,
593 LPDIRECTDRAWSURFACE7 *lplpGDIDDSSurface);
595 Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7 iface,LPDWORD freq);
597 Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine);
599 Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc,
600 LPDIRECTDRAWSURFACE7 *lpDDS);
602 Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL status);
604 Main_DirectDraw_Initialize(LPDIRECTDRAW7 iface, LPGUID lpGuid);
605 HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface);
607 Main_DirectDraw_SetCooperativeLevel(LPDIRECTDRAW7 iface, HWND hwnd,
610 Main_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
611 DWORD dwHeight, LONG lPitch,
612 DWORD dwRefreshRate, DWORD dwFlags,
613 const DDPIXELFORMAT* pixelformat);
614 HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface);
616 Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
619 Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD);
621 Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface,LPDDSCAPS2 ddscaps,
622 LPDWORD total, LPDWORD free);
623 HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface);
625 Main_DirectDraw_StartModeTest(LPDIRECTDRAW7 iface, LPSIZE pModes,
626 DWORD dwNumModes, DWORD dwFlags);
628 /*****************************************************************************
629 * IDirectDraw USER object declarations
631 #define USER_DDRAW_PRIV(ddraw) ((User_DirectDrawImpl*)((ddraw)->private))
632 #define USER_DDRAW_PRIV_VAR(name,ddraw) \
633 User_DirectDrawImpl* name = USER_DDRAW_PRIV(ddraw)
639 } User_DirectDrawImpl_Part;
643 User_DirectDrawImpl_Part user;
644 } User_DirectDrawImpl;
646 void User_DirectDraw_final_release(IDirectDrawImpl* This);
647 HRESULT User_DirectDraw_create_primary(IDirectDrawImpl* This,
648 const DDSURFACEDESC2* pDDSD,
649 LPDIRECTDRAWSURFACE7* ppSurf,
651 HRESULT User_DirectDraw_create_backbuffer(IDirectDrawImpl* This,
652 const DDSURFACEDESC2* pDDSD,
653 LPDIRECTDRAWSURFACE7* ppSurf,
655 IDirectDrawSurfaceImpl* primary);
656 HRESULT User_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex);
657 HRESULT User_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface,
658 IUnknown* pUnkOuter, BOOL ex);
661 User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
662 LPDDSURFACEDESC2 pDDSD, LPVOID context,
663 LPDDENUMMODESCALLBACK2 callback);
665 User_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface,
666 LPDDDEVICEIDENTIFIER2 pDDDI,
669 User_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
670 DWORD dwHeight, DWORD dwBPP,
671 DWORD dwRefreshRate, DWORD dwFlags);
673 /*****************************************************************************
674 * IDirectDraw HAL declarations
676 #define HAL_DDRAW_PRIV(ddraw) \
677 ((HAL_DirectDrawImpl*)((ddraw)->private))
678 #define HAL_DDRAW_PRIV_VAR(name,ddraw) \
679 HAL_DirectDrawImpl* name = HAL_DDRAW_PRIV(ddraw)
684 } HAL_DirectDrawImpl_Part;
688 User_DirectDrawImpl_Part user;
689 HAL_DirectDrawImpl_Part hal;
690 } HAL_DirectDrawImpl;
692 void HAL_DirectDraw_final_release(IDirectDrawImpl* This);
693 HRESULT HAL_DirectDraw_create_primary(IDirectDrawImpl* This,
694 const DDSURFACEDESC2* pDDSD,
695 LPDIRECTDRAWSURFACE7* ppSurf,
697 HRESULT HAL_DirectDraw_create_backbuffer(IDirectDrawImpl* This,
698 const DDSURFACEDESC2* pDDSD,
699 LPDIRECTDRAWSURFACE7* ppSurf,
701 IDirectDrawSurfaceImpl* primary);
702 HRESULT HAL_DirectDraw_create_texture(IDirectDrawImpl* This,
703 const DDSURFACEDESC2* pDDSD,
704 LPDIRECTDRAWSURFACE7* ppSurf,
706 DWORD dwMipMapLevel);
708 HRESULT HAL_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex);
709 HRESULT HAL_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface,
710 IUnknown* pUnkOuter, BOOL ex);
713 HAL_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface,
714 LPDDDEVICEIDENTIFIER2 pDDDI,
717 HAL_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
718 DWORD dwHeight, DWORD dwBPP,
719 DWORD dwRefreshRate, DWORD dwFlags);
720 HRESULT WINAPI HAL_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface);
722 /*****************************************************************************
723 * IDirectDrawSurface MAIN declarations
725 /* Support for IDirectDrawSurface7::Set/Get/FreePrivateData. I don't think
726 * anybody uses it for much so a good implementation is optional. */
727 typedef struct PrivateData
729 struct PrivateData* next;
730 struct PrivateData* prev;
733 DWORD flags; /* DDSPD_* */
734 DWORD uniqueness_value;
745 extern const IDirectDrawGammaControlVtbl DDRAW_IDDGC_VTable;
747 /* Non-interface functions */
748 HRESULT Main_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
749 IDirectDrawImpl* pDD,
750 const DDSURFACEDESC2* pDDSD);
751 void Main_DirectDrawSurface_ForceDestroy(IDirectDrawSurfaceImpl* This);
753 void Main_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
754 HRESULT Main_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This);
755 BOOL Main_DirectDrawSurface_attach(IDirectDrawSurfaceImpl *This,
756 IDirectDrawSurfaceImpl *to);
757 BOOL Main_DirectDrawSurface_detach(IDirectDrawSurfaceImpl *This);
758 void Main_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
759 LPCRECT pRect, DWORD dwFlags);
760 void Main_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
762 void Main_DirectDrawSurface_lose_surface(IDirectDrawSurfaceImpl* This);
763 void Main_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
764 IDirectDrawPaletteImpl* pal);
765 void Main_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
766 IDirectDrawPaletteImpl* pal,
767 DWORD dwStart, DWORD dwCount,
768 LPPALETTEENTRY palent);
769 HWND Main_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
771 HRESULT Main_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl* This,
773 LPDDGAMMARAMP lpGammaRamp);
774 HRESULT Main_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl* This,
776 LPDDGAMMARAMP lpGammaRamp);
778 BOOL Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
779 IDirectDrawSurfaceImpl* back,
782 #define CHECK_LOST(This) \
784 if (This->lost) return DDERR_SURFACELOST; \
787 #define CHECK_TEXTURE(This) \
789 if (!(This->surface_desc.ddsCaps.dwCaps2 \
790 & DDSCAPS2_TEXTUREMANAGE)) \
791 return DDERR_INVALIDOBJECT; \
794 #define LOCK_OBJECT(This) do { } while (0)
795 #define UNLOCK_OBJECT(This) do { } while (0)
797 /* IDirectDrawSurface7 (partial) implementation */
798 ULONG WINAPI Main_DirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface);
799 ULONG WINAPI Main_DirectDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface);
801 Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
804 Main_DirectDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
805 LPDIRECTDRAWSURFACE7 pAttach);
807 Main_DirectDrawSurface_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE7 iface,
810 Main_DirectDrawSurface_BltBatch(LPDIRECTDRAWSURFACE7 iface,
811 LPDDBLTBATCH pBatch, DWORD dwCount,
814 Main_DirectDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE7 iface);
816 Main_DirectDrawSurface_DeleteAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
818 LPDIRECTDRAWSURFACE7 pAttach);
820 Main_DirectDrawSurface_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE7 iface,
822 LPDDENUMSURFACESCALLBACK7 cb);
824 Main_DirectDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE7 iface,
825 DWORD dwFlags, LPVOID context,
826 LPDDENUMSURFACESCALLBACK7 cb);
828 Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface,
829 LPDIRECTDRAWSURFACE7 override, DWORD dwFlags);
831 Main_DirectDrawSurface_FreePrivateData(LPDIRECTDRAWSURFACE7 iface,
834 Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
836 LPDIRECTDRAWSURFACE7* ppSurface);
838 Main_DirectDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE7 iface,
841 Main_DirectDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface,
844 Main_DirectDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface,
845 LPDIRECTDRAWCLIPPER* ppClipper);
847 Main_DirectDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface,
848 DWORD dwFlags, LPDDCOLORKEY pCKey);
850 Main_DirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC);
852 Main_DirectDrawSurface_GetDDInterface(LPDIRECTDRAWSURFACE7 iface,
855 Main_DirectDrawSurface_GetFlipStatus(LPDIRECTDRAWSURFACE7 iface,
858 Main_DirectDrawSurface_GetLOD(LPDIRECTDRAWSURFACE7 iface,
861 Main_DirectDrawSurface_GetOverlayPosition(LPDIRECTDRAWSURFACE7 iface,
862 LPLONG pX, LPLONG pY);
864 Main_DirectDrawSurface_GetPalette(LPDIRECTDRAWSURFACE7 iface,
865 LPDIRECTDRAWPALETTE* ppPalette);
867 Main_DirectDrawSurface_GetPixelFormat(LPDIRECTDRAWSURFACE7 iface,
868 LPDDPIXELFORMAT pDDPixelFormat);
870 Main_DirectDrawSurface_GetPriority(LPDIRECTDRAWSURFACE7 iface,
871 LPDWORD pdwPriority);
873 Main_DirectDrawSurface_GetPrivateData(LPDIRECTDRAWSURFACE7 iface, REFGUID tag,
874 LPVOID pBuffer, LPDWORD pcbBufferSize);
876 Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
877 LPDDSURFACEDESC2 pDDSD);
879 Main_DirectDrawSurface_GetUniquenessValue(LPDIRECTDRAWSURFACE7 iface,
882 Main_DirectDrawSurface_Initialize(LPDIRECTDRAWSURFACE7 iface,
883 LPDIRECTDRAW pDD, LPDDSURFACEDESC2 pDDSD);
885 Main_DirectDrawSurface_IsLost(LPDIRECTDRAWSURFACE7 iface);
887 Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
888 LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE h);
890 Main_DirectDrawSurface_PageLock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags);
892 Main_DirectDrawSurface_PageUnlock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags);
894 Main_DirectDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC);
896 Main_DirectDrawSurface_SetClipper(LPDIRECTDRAWSURFACE7 iface,
897 LPDIRECTDRAWCLIPPER pDDClipper);
899 Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface,
900 DWORD dwFlags, LPDDCOLORKEY pCKey);
902 Main_DirectDrawSurface_SetLOD(LPDIRECTDRAWSURFACE7 iface, DWORD dwMaxLOD);
904 Main_DirectDrawSurface_SetOverlayPosition(LPDIRECTDRAWSURFACE7 iface,
907 Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
908 LPDIRECTDRAWPALETTE pPalette);
910 Main_DirectDrawSurface_SetPriority(LPDIRECTDRAWSURFACE7 iface,
913 Main_DirectDrawSurface_SetPrivateData(LPDIRECTDRAWSURFACE7 iface,
914 REFGUID tag, LPVOID pData,
915 DWORD cbSize, DWORD dwFlags);
917 Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect);
919 Main_DirectDrawSurface_UpdateOverlay(LPDIRECTDRAWSURFACE7 iface,
921 LPDIRECTDRAWSURFACE7 pDstSurface,
922 LPRECT pDstRect, DWORD dwFlags,
925 Main_DirectDrawSurface_UpdateOverlayDisplay(LPDIRECTDRAWSURFACE7 iface,
928 Main_DirectDrawSurface_UpdateOverlayZOrder(LPDIRECTDRAWSURFACE7 iface,
930 LPDIRECTDRAWSURFACE7 pDDSRef);
932 /*****************************************************************************
933 * IDirectDrawSurface DIB declarations
935 #define DIB_PRIV(surf) ((DIB_DirectDrawSurfaceImpl*)((surf)->private))
937 #define DIB_PRIV_VAR(name, surf) \
938 DIB_DirectDrawSurfaceImpl* name = DIB_PRIV(surf)
940 struct DIB_DirectDrawSurfaceImpl_Part
946 DWORD d3d_data[4]; /* room for Direct3D driver data */
951 struct DIB_DirectDrawSurfaceImpl_Part dib;
952 } DIB_DirectDrawSurfaceImpl;
955 DIB_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl *This,
956 IDirectDrawImpl *pDD,
957 const DDSURFACEDESC2 *pDDSD);
959 DIB_DirectDrawSurface_Create(IDirectDrawImpl *pDD,
960 const DDSURFACEDESC2 *pDDSD,
961 LPDIRECTDRAWSURFACE7 *ppSurf,
962 IUnknown *pUnkOuter);
964 void DIB_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
965 BOOL DIB_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
966 IDirectDrawSurfaceImpl* back,
969 void DIB_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
970 IDirectDrawPaletteImpl* pal);
971 void DIB_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
972 IDirectDrawPaletteImpl* pal,
973 DWORD dwStart, DWORD dwCount,
974 LPPALETTEENTRY palent);
976 HRESULT DIB_DirectDrawSurface_get_dc(IDirectDrawSurfaceImpl* This, HDC* phDC);
977 HRESULT DIB_DirectDrawSurface_release_dc(IDirectDrawSurfaceImpl* This,HDC hDC);
979 HRESULT DIB_DirectDrawSurface_alloc_dc(IDirectDrawSurfaceImpl* This,HDC* phDC);
980 HRESULT DIB_DirectDrawSurface_free_dc(IDirectDrawSurfaceImpl* This, HDC hDC);
983 DIB_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT prcDest,
984 LPDIRECTDRAWSURFACE7 pSrcSurf, LPRECT prcSrc,
985 DWORD dwFlags, LPDDBLTFX pBltFx);
987 DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dwX,
988 DWORD dwY, LPDIRECTDRAWSURFACE7 pSrcSurf,
989 LPRECT prcSrc, DWORD dwTrans);
990 HRESULT WINAPI DIB_DirectDrawSurface_Restore(LPDIRECTDRAWSURFACE7 iface);
992 DIB_DirectDrawSurface_SetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
993 LPDDSURFACEDESC2 pDDSD, DWORD dwFlags);
995 /*****************************************************************************
996 * IDirectDrawSurface USER declarations
998 #define USER_PRIV(surf) ((User_DirectDrawSurfaceImpl*)((surf)->private))
1000 #define USER_PRIV_VAR(name,surf) \
1001 User_DirectDrawSurfaceImpl* name = USER_PRIV(surf)
1003 struct User_DirectDrawSurfaceImpl_Part
1007 HANDLE update_thread, update_event, refresh_event;
1008 volatile int wait_count, in_refresh;
1009 CRITICAL_SECTION crit;
1014 struct DIB_DirectDrawSurfaceImpl_Part dib;
1015 struct User_DirectDrawSurfaceImpl_Part user;
1016 } User_DirectDrawSurfaceImpl;
1018 HRESULT User_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
1019 IDirectDrawImpl* pDD,
1020 const DDSURFACEDESC2* pDDSD);
1022 HRESULT User_DirectDrawSurface_Create(IDirectDrawImpl *pDD,
1023 const DDSURFACEDESC2 *pDDSD,
1024 LPDIRECTDRAWSURFACE7 *ppSurf,
1025 IUnknown *pUnkOuter);
1027 void User_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
1029 void User_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
1030 LPCRECT pRect, DWORD dwFlags);
1031 void User_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
1033 void User_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
1034 IDirectDrawPaletteImpl* pal);
1035 void User_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
1036 IDirectDrawPaletteImpl* pal,
1037 DWORD dwStart, DWORD dwCount,
1038 LPPALETTEENTRY palent);
1039 HRESULT User_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
1040 LPDIRECTDRAWSURFACE7* ppDup);
1041 BOOL User_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
1042 IDirectDrawSurfaceImpl* back,
1044 void User_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This,
1046 HWND User_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
1048 HRESULT User_DirectDrawSurface_get_dc(IDirectDrawSurfaceImpl* This, HDC* phDC);
1049 HRESULT User_DirectDrawSurface_release_dc(IDirectDrawSurfaceImpl* This,
1052 HRESULT User_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl* This,
1054 LPDDGAMMARAMP lpGammaRamp);
1055 HRESULT User_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl* This,
1057 LPDDGAMMARAMP lpGammaRamp);
1059 /*****************************************************************************
1060 * IDirectDrawSurface HAL declarations
1062 #define HAL_PRIV(surf) ((HAL_DirectDrawSurfaceImpl*)((surf)->private))
1064 #define HAL_PRIV_VAR(name,surf) \
1065 HAL_DirectDrawSurfaceImpl* name = HAL_PRIV(surf)
1067 struct HAL_DirectDrawSurfaceImpl_Part
1071 DWORD fb_pitch, fb_vofs;
1076 struct DIB_DirectDrawSurfaceImpl_Part dib;
1077 struct User_DirectDrawSurfaceImpl_Part user;
1078 struct HAL_DirectDrawSurfaceImpl_Part hal;
1079 } HAL_DirectDrawSurfaceImpl;
1081 HRESULT HAL_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
1082 IDirectDrawImpl* pDD,
1083 const DDSURFACEDESC2* pDDSD);
1085 HRESULT HAL_DirectDrawSurface_Create(IDirectDrawImpl *pDD,
1086 const DDSURFACEDESC2 *pDDSD,
1087 LPDIRECTDRAWSURFACE7 *ppSurf,
1088 IUnknown *pUnkOuter);
1090 void HAL_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
1091 HRESULT HAL_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This);
1093 void HAL_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
1094 IDirectDrawPaletteImpl* pal);
1095 void HAL_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
1096 IDirectDrawPaletteImpl* pal,
1097 DWORD dwStart, DWORD dwCount,
1098 LPPALETTEENTRY palent);
1099 HRESULT HAL_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
1100 LPDIRECTDRAWSURFACE7* ppDup);
1101 void HAL_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
1102 LPCRECT pRect, DWORD dwFlags);
1103 void HAL_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
1105 BOOL HAL_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
1106 IDirectDrawSurfaceImpl* back,
1108 void HAL_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This,
1110 HWND HAL_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
1112 /*****************************************************************************
1113 * IDirectDrawSurface FAKEZBUFFER declarations
1118 } FakeZBuffer_DirectDrawSurfaceImpl;
1120 HRESULT FakeZBuffer_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
1121 IDirectDrawImpl* pDD,
1122 const DDSURFACEDESC2* pDDSD);
1124 HRESULT FakeZBuffer_DirectDrawSurface_Create(IDirectDrawImpl* pDD,
1125 const DDSURFACEDESC2* pDDSD,
1126 LPDIRECTDRAWSURFACE7* ppSurf,
1127 IUnknown* pUnkOuter);
1129 void FakeZBuffer_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
1131 HRESULT FakeZBuffer_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
1132 LPDIRECTDRAWSURFACE7* ppDup);
1134 #endif /* __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H */