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 DDRAW_DSURFACE_MAIN_H_INCLUDED
20 #define DDRAW_DSURFACE_MAIN_H_INCLUDED
26 #include "ddraw_private.h"
28 /* Support for IDirectDrawSurface7::Set/Get/FreePrivateData. I don't think
29 * anybody uses it for much so a good implementation is optional. */
30 typedef struct PrivateData
32 struct PrivateData
* next
;
33 struct PrivateData
* prev
;
36 DWORD flags
; /* DDSPD_* */
37 DWORD uniqueness_value
;
48 extern IDirectDrawGammaControlVtbl DDRAW_IDDGC_VTable
;
50 /* Non-interface functions */
52 Main_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl
* This
,
54 const DDSURFACEDESC2
* pDDSD
);
55 void Main_DirectDrawSurface_ForceDestroy(IDirectDrawSurfaceImpl
* This
);
58 Main_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl
* This
);
60 Main_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl
* This
);
62 Main_DirectDrawSurface_attach(IDirectDrawSurfaceImpl
*This
,
63 IDirectDrawSurfaceImpl
*to
);
64 BOOL
Main_DirectDrawSurface_detach(IDirectDrawSurfaceImpl
*This
);
66 Main_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl
* This
,
67 LPCRECT pRect
, DWORD dwFlags
);
69 Main_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl
* This
,
72 Main_DirectDrawSurface_lose_surface(IDirectDrawSurfaceImpl
* This
);
74 Main_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl
* This
,
75 IDirectDrawPaletteImpl
* pal
);
77 Main_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl
* This
,
78 IDirectDrawPaletteImpl
* pal
,
79 DWORD dwStart
, DWORD dwCount
,
80 LPPALETTEENTRY palent
);
82 Main_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl
* This
);
85 Main_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl
* This
,
87 LPDDGAMMARAMP lpGammaRamp
);
89 Main_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl
* This
,
91 LPDDGAMMARAMP lpGammaRamp
);
93 BOOL
Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl
* front
,
94 IDirectDrawSurfaceImpl
* back
,
97 #define CHECK_LOST(This) \
99 if (This->lost) return DDERR_SURFACELOST; \
102 #define CHECK_TEXTURE(This) \
104 if (!(This->surface_desc.ddsCaps.dwCaps2 \
105 & DDSCAPS2_TEXTUREMANAGE)) \
106 return DDERR_INVALIDOBJECT; \
109 #define LOCK_OBJECT(This) do { } while (0)
110 #define UNLOCK_OBJECT(This) do { } while (0)
112 /* IDirectDrawSurface7 (partial) implementation */
114 Main_DirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface
);
116 Main_DirectDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface
);
118 Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface
, REFIID riid
,
121 Main_DirectDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface
,
122 LPDIRECTDRAWSURFACE7 pAttach
);
124 Main_DirectDrawSurface_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE7 iface
,
127 Main_DirectDrawSurface_BltBatch(LPDIRECTDRAWSURFACE7 iface
,
128 LPDDBLTBATCH pBatch
, DWORD dwCount
,
131 Main_DirectDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE7 iface
);
133 Main_DirectDrawSurface_DeleteAttachedSurface(LPDIRECTDRAWSURFACE7 iface
,
135 LPDIRECTDRAWSURFACE7 pAttach
);
137 Main_DirectDrawSurface_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE7 iface
,
139 LPDDENUMSURFACESCALLBACK7 cb
);
141 Main_DirectDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE7 iface
,
142 DWORD dwFlags
, LPVOID context
,
143 LPDDENUMSURFACESCALLBACK7 cb
);
145 Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface
,
146 LPDIRECTDRAWSURFACE7 override
, DWORD dwFlags
);
148 Main_DirectDrawSurface_FreePrivateData(LPDIRECTDRAWSURFACE7 iface
,
151 Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface
,
153 LPDIRECTDRAWSURFACE7
* ppSurface
);
155 Main_DirectDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE7 iface
,
158 Main_DirectDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface
,
161 Main_DirectDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface
,
162 LPDIRECTDRAWCLIPPER
* ppClipper
);
164 Main_DirectDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface
,
165 DWORD dwFlags
, LPDDCOLORKEY pCKey
);
167 Main_DirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface
, HDC
*phDC
);
169 Main_DirectDrawSurface_GetDDInterface(LPDIRECTDRAWSURFACE7 iface
,
172 Main_DirectDrawSurface_GetFlipStatus(LPDIRECTDRAWSURFACE7 iface
,
175 Main_DirectDrawSurface_GetLOD(LPDIRECTDRAWSURFACE7 iface
,
178 Main_DirectDrawSurface_GetOverlayPosition(LPDIRECTDRAWSURFACE7 iface
,
179 LPLONG pX
, LPLONG pY
);
181 Main_DirectDrawSurface_GetPalette(LPDIRECTDRAWSURFACE7 iface
,
182 LPDIRECTDRAWPALETTE
* ppPalette
);
184 Main_DirectDrawSurface_GetPixelFormat(LPDIRECTDRAWSURFACE7 iface
,
185 LPDDPIXELFORMAT pDDPixelFormat
);
187 Main_DirectDrawSurface_GetPriority(LPDIRECTDRAWSURFACE7 iface
,
188 LPDWORD pdwPriority
);
190 Main_DirectDrawSurface_GetPrivateData(LPDIRECTDRAWSURFACE7 iface
, REFGUID tag
,
191 LPVOID pBuffer
, LPDWORD pcbBufferSize
);
193 Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface
,
194 LPDDSURFACEDESC2 pDDSD
);
196 Main_DirectDrawSurface_GetUniquenessValue(LPDIRECTDRAWSURFACE7 iface
,
199 Main_DirectDrawSurface_Initialize(LPDIRECTDRAWSURFACE7 iface
,
200 LPDIRECTDRAW pDD
, LPDDSURFACEDESC2 pDDSD
);
202 Main_DirectDrawSurface_IsLost(LPDIRECTDRAWSURFACE7 iface
);
204 Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface
, LPRECT prect
,
205 LPDDSURFACEDESC2 pDDSD
, DWORD flags
, HANDLE h
);
207 Main_DirectDrawSurface_PageLock(LPDIRECTDRAWSURFACE7 iface
, DWORD dwFlags
);
209 Main_DirectDrawSurface_PageUnlock(LPDIRECTDRAWSURFACE7 iface
, DWORD dwFlags
);
211 Main_DirectDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface
, HDC hDC
);
213 Main_DirectDrawSurface_SetClipper(LPDIRECTDRAWSURFACE7 iface
,
214 LPDIRECTDRAWCLIPPER pDDClipper
);
216 Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface
,
217 DWORD dwFlags
, LPDDCOLORKEY pCKey
);
219 Main_DirectDrawSurface_SetLOD(LPDIRECTDRAWSURFACE7 iface
, DWORD dwMaxLOD
);
221 Main_DirectDrawSurface_SetOverlayPosition(LPDIRECTDRAWSURFACE7 iface
,
224 Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface
,
225 LPDIRECTDRAWPALETTE pPalette
);
227 Main_DirectDrawSurface_SetPriority(LPDIRECTDRAWSURFACE7 iface
,
230 Main_DirectDrawSurface_SetPrivateData(LPDIRECTDRAWSURFACE7 iface
,
231 REFGUID tag
, LPVOID pData
,
232 DWORD cbSize
, DWORD dwFlags
);
234 Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface
, LPRECT pRect
);
236 Main_DirectDrawSurface_UpdateOverlay(LPDIRECTDRAWSURFACE7 iface
,
238 LPDIRECTDRAWSURFACE7 pDstSurface
,
239 LPRECT pDstRect
, DWORD dwFlags
,
242 Main_DirectDrawSurface_UpdateOverlayDisplay(LPDIRECTDRAWSURFACE7 iface
,
245 Main_DirectDrawSurface_UpdateOverlayZOrder(LPDIRECTDRAWSURFACE7 iface
,
247 LPDIRECTDRAWSURFACE7 pDDSRef
);