1 /* Copyright 2000-2001 TransGaming Technologies Inc. */
3 #ifndef DDRAW_DSURFACE_MAIN_H_INCLUDED
4 #define DDRAW_DSURFACE_MAIN_H_INCLUDED
6 #include "ddraw_private.h"
8 /* Support for IDirectDrawSurface7::Set/Get/FreePrivateData. I don't think
9 * anybody uses it for much so a good implementation is optional. */
10 typedef struct PrivateData
12 struct PrivateData* next;
13 struct PrivateData* prev;
16 DWORD flags; /* DDSPD_* */
17 DWORD uniqueness_value;
28 extern ICOM_VTABLE(IDirectDrawGammaControl) DDRAW_IDDGC_VTable;
30 /* Non-interface functions */
32 Main_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
34 const DDSURFACEDESC2* pDDSD);
35 void Main_DirectDrawSurface_ForceDestroy(IDirectDrawSurfaceImpl* This);
38 Main_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
40 Main_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This);
42 Main_DirectDrawSurface_attach(IDirectDrawSurfaceImpl *This,
43 IDirectDrawSurfaceImpl *to);
44 BOOL Main_DirectDrawSurface_detach(IDirectDrawSurfaceImpl *This);
46 Main_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
49 Main_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
52 Main_DirectDrawSurface_lose_surface(IDirectDrawSurfaceImpl* This);
54 Main_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
55 IDirectDrawPaletteImpl* pal);
57 Main_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
58 IDirectDrawPaletteImpl* pal,
59 DWORD dwStart, DWORD dwCount,
60 LPPALETTEENTRY palent);
62 Main_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
65 Main_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl* This,
67 LPDDGAMMARAMP lpGammaRamp);
69 Main_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl* This,
71 LPDDGAMMARAMP lpGammaRamp);
73 BOOL Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
74 IDirectDrawSurfaceImpl* back,
77 #define CHECK_LOST(This) \
79 if (This->lost) return DDERR_SURFACELOST; \
82 #define CHECK_TEXTURE(This) \
84 if (!(This->surface_desc.ddsCaps.dwCaps2 \
85 & DDSCAPS2_TEXTUREMANAGE)) \
86 return DDERR_INVALIDOBJECT; \
89 #define LOCK_OBJECT(This) do { } while (0)
90 #define UNLOCK_OBJECT(This) do { } while (0)
92 /* IDirectDrawSurface7 (partial) implementation */
94 Main_DirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface);
96 Main_DirectDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface);
98 Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
101 Main_DirectDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
102 LPDIRECTDRAWSURFACE7 pAttach);
104 Main_DirectDrawSurface_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE7 iface,
107 Main_DirectDrawSurface_BltBatch(LPDIRECTDRAWSURFACE7 iface,
108 LPDDBLTBATCH pBatch, DWORD dwCount,
111 Main_DirectDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE7 iface);
113 Main_DirectDrawSurface_DeleteAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
115 LPDIRECTDRAWSURFACE7 pAttach);
117 Main_DirectDrawSurface_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE7 iface,
119 LPDDENUMSURFACESCALLBACK7 cb);
121 Main_DirectDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE7 iface,
122 DWORD dwFlags, LPVOID context,
123 LPDDENUMSURFACESCALLBACK7 cb);
125 Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface,
126 LPDIRECTDRAWSURFACE7 override, DWORD dwFlags);
128 Main_DirectDrawSurface_FreePrivateData(LPDIRECTDRAWSURFACE7 iface,
131 Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
133 LPDIRECTDRAWSURFACE7* ppSurface);
135 Main_DirectDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE7 iface,
138 Main_DirectDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface,
141 Main_DirectDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface,
142 LPDIRECTDRAWCLIPPER* ppClipper);
144 Main_DirectDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface,
145 DWORD dwFlags, LPDDCOLORKEY pCKey);
147 Main_DirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC);
149 Main_DirectDrawSurface_GetDDInterface(LPDIRECTDRAWSURFACE7 iface,
152 Main_DirectDrawSurface_GetFlipStatus(LPDIRECTDRAWSURFACE7 iface,
155 Main_DirectDrawSurface_GetLOD(LPDIRECTDRAWSURFACE7 iface,
158 Main_DirectDrawSurface_GetOverlayPosition(LPDIRECTDRAWSURFACE7 iface,
159 LPLONG pX, LPLONG pY);
161 Main_DirectDrawSurface_GetPalette(LPDIRECTDRAWSURFACE7 iface,
162 LPDIRECTDRAWPALETTE* ppPalette);
164 Main_DirectDrawSurface_GetPixelFormat(LPDIRECTDRAWSURFACE7 iface,
165 LPDDPIXELFORMAT pDDPixelFormat);
167 Main_DirectDrawSurface_GetPriority(LPDIRECTDRAWSURFACE7 iface,
168 LPDWORD pdwPriority);
170 Main_DirectDrawSurface_GetPrivateData(LPDIRECTDRAWSURFACE7 iface, REFGUID tag,
171 LPVOID pBuffer, LPDWORD pcbBufferSize);
173 Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
174 LPDDSURFACEDESC2 pDDSD);
176 Main_DirectDrawSurface_GetUniquenessValue(LPDIRECTDRAWSURFACE7 iface,
179 Main_DirectDrawSurface_Initialize(LPDIRECTDRAWSURFACE7 iface,
180 LPDIRECTDRAW pDD, LPDDSURFACEDESC2 pDDSD);
182 Main_DirectDrawSurface_IsLost(LPDIRECTDRAWSURFACE7 iface);
184 Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
185 LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE h);
187 Main_DirectDrawSurface_PageLock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags);
189 Main_DirectDrawSurface_PageUnlock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags);
191 Main_DirectDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC);
193 Main_DirectDrawSurface_SetClipper(LPDIRECTDRAWSURFACE7 iface,
194 LPDIRECTDRAWCLIPPER pDDClipper);
196 Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface,
197 DWORD dwFlags, LPDDCOLORKEY pCKey);
199 Main_DirectDrawSurface_SetLOD(LPDIRECTDRAWSURFACE7 iface, DWORD dwMaxLOD);
201 Main_DirectDrawSurface_SetOverlayPosition(LPDIRECTDRAWSURFACE7 iface,
204 Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
205 LPDIRECTDRAWPALETTE pPalette);
207 Main_DirectDrawSurface_SetPriority(LPDIRECTDRAWSURFACE7 iface,
210 Main_DirectDrawSurface_SetPrivateData(LPDIRECTDRAWSURFACE7 iface,
211 REFGUID tag, LPVOID pData,
212 DWORD cbSize, DWORD dwFlags);
214 Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect);
216 Main_DirectDrawSurface_UpdateOverlay(LPDIRECTDRAWSURFACE7 iface,
218 LPDIRECTDRAWSURFACE7 pDstSurface,
219 LPRECT pDstRect, DWORD dwFlags,
222 Main_DirectDrawSurface_UpdateOverlayDisplay(LPDIRECTDRAWSURFACE7 iface,
225 Main_DirectDrawSurface_UpdateOverlayZOrder(LPDIRECTDRAWSURFACE7 iface,
227 LPDIRECTDRAWSURFACE7 pDDSRef);