- proper (tested on Win2K) reference counting for Direct3D object
[wine] / dlls / ddraw / dsurface / hal.h
1 /*
2  * Copyright 2000-2001 TransGaming Technologies Inc.
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #ifndef DDRAW_DSURFACE_HAL_H_INCLUDED
20 #define DDRAW_DSURFACE_HAL_H_INCLUDED
21
22 #define HAL_PRIV(surf) ((HAL_DirectDrawSurfaceImpl*)((surf)->private))
23
24 #define HAL_PRIV_VAR(name,surf) \
25         HAL_DirectDrawSurfaceImpl* name = HAL_PRIV(surf)
26
27 struct HAL_DirectDrawSurfaceImpl_Part
28 {
29     DWORD need_late;
30     LPVOID fb_addr;
31     DWORD fb_pitch, fb_vofs;
32 };
33
34 typedef struct
35 {
36     struct DIB_DirectDrawSurfaceImpl_Part dib;
37     struct User_DirectDrawSurfaceImpl_Part user;
38     struct HAL_DirectDrawSurfaceImpl_Part hal;
39 } HAL_DirectDrawSurfaceImpl;
40
41 HRESULT
42 HAL_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
43                                 IDirectDrawImpl* pDD,
44                                 const DDSURFACEDESC2* pDDSD);
45
46 HRESULT
47 HAL_DirectDrawSurface_Create(IDirectDrawImpl *pDD,
48                              const DDSURFACEDESC2 *pDDSD,
49                              LPDIRECTDRAWSURFACE7 *ppSurf,
50                              IUnknown *pUnkOuter);
51
52 void HAL_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
53 HRESULT HAL_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This);
54
55 void HAL_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
56                                        IDirectDrawPaletteImpl* pal);
57 void HAL_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
58                                           IDirectDrawPaletteImpl* pal,
59                                           DWORD dwStart, DWORD dwCount,
60                                           LPPALETTEENTRY palent);
61 HRESULT HAL_DirectDrawSurface_duplicate_surface(IDirectDrawSurfaceImpl* This,
62                                                 LPDIRECTDRAWSURFACE7* ppDup);
63 void HAL_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
64                                        LPCRECT pRect, DWORD dwFlags);
65 void HAL_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
66                                          LPCRECT pRect);
67 BOOL HAL_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
68                                      IDirectDrawSurfaceImpl* back,
69                                      DWORD dwFlags);
70 void HAL_DirectDrawSurface_flip_update(IDirectDrawSurfaceImpl* This,
71                                        DWORD dwFlags);
72 HWND HAL_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
73
74 #endif