Add support for more than 2 audio channels.
[wine] / dlls / ddraw / dsurface / gamma.c
1 /*              DirectDrawGammaControl implementation
2  *
3  * Copyright 2001 TransGaming Technologies Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #include "config.h"
21 #include "winerror.h"
22
23 #include <assert.h>
24 #include <stdlib.h>
25
26 #define CONST_VTABLE
27
28 #include "wine/debug.h"
29 #include "ddraw_private.h"
30 #include "dsurface/main.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
33
34 #define CONVERT(pddgc) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,       \
35                                           IDirectDrawGammaControl,      \
36                                           IDirectDrawSurface7,          \
37                                           (pddgc))
38
39 static HRESULT WINAPI
40 DirectDrawGammaControl_QueryInterface(LPDIRECTDRAWGAMMACONTROL iface, REFIID riid,
41                                       LPVOID *ppObj)
42 {
43     TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ppObj);
44     return E_NOINTERFACE;
45 }
46
47 static ULONG WINAPI
48 DirectDrawGammaControl_AddRef(LPDIRECTDRAWGAMMACONTROL iface)
49 {
50     return IDirectDrawSurface7_AddRef(CONVERT(iface));
51 }
52
53 static ULONG WINAPI
54 DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface)
55 {
56     return IDirectDrawSurface7_Release(CONVERT(iface));
57 }
58
59 static HRESULT WINAPI
60 DirectDrawGammaControl_GetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp)
61 {
62     ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawGammaControl, iface);
63     TRACE("(%p)->(%08lx,%p)\n", iface,dwFlags,lpGammaRamp);
64     return This->get_gamma_ramp(This, dwFlags, lpGammaRamp);
65 }
66
67 static HRESULT WINAPI
68 DirectDrawGammaControl_SetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp)
69 {
70     ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawGammaControl, iface);
71     TRACE("(%p)->(%08lx,%p)\n", iface,dwFlags,lpGammaRamp);
72     return This->set_gamma_ramp(This, dwFlags, lpGammaRamp);
73 }
74
75 const IDirectDrawGammaControlVtbl DDRAW_IDDGC_VTable =
76 {
77     DirectDrawGammaControl_QueryInterface,
78     DirectDrawGammaControl_AddRef,
79     DirectDrawGammaControl_Release,
80     DirectDrawGammaControl_GetGammaRamp,
81     DirectDrawGammaControl_SetGammaRamp
82 };