Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 1 | /* DirectDrawGammaControl implementation |
| 2 | * |
| 3 | * Copyright 2001 TransGaming Technologies Inc. |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 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 |
Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #include "config.h" |
| 21 | #include "winerror.h" |
| 22 | |
| 23 | #include <assert.h> |
| 24 | #include <stdlib.h> |
| 25 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 26 | #include "wine/debug.h" |
Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 27 | #include "ddraw_private.h" |
| 28 | #include "dsurface/main.h" |
| 29 | |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 30 | WINE_DEFAULT_DEBUG_CHANNEL(ddraw); |
Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 31 | |
| 32 | #define CONVERT(pddgc) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, \ |
| 33 | IDirectDrawGammaControl, \ |
| 34 | IDirectDrawSurface7, \ |
| 35 | (pddgc)) |
| 36 | |
| 37 | static HRESULT WINAPI |
| 38 | DirectDrawGammaControl_QueryInterface(LPDIRECTDRAWGAMMACONTROL iface, REFIID riid, |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame^] | 39 | LPVOID *ppObj) |
Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 40 | { |
| 41 | TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ppObj); |
| 42 | return E_NOINTERFACE; |
| 43 | } |
| 44 | |
| 45 | static ULONG WINAPI |
| 46 | DirectDrawGammaControl_AddRef(LPDIRECTDRAWGAMMACONTROL iface) |
| 47 | { |
| 48 | return IDirectDrawSurface7_AddRef(CONVERT(iface)); |
| 49 | } |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame^] | 50 | |
Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 51 | static ULONG WINAPI |
| 52 | DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface) |
| 53 | { |
| 54 | return IDirectDrawSurface7_Release(CONVERT(iface)); |
| 55 | } |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame^] | 56 | |
Ove Kaaven | e37b1d3 | 2001-04-16 19:35:18 +0000 | [diff] [blame] | 57 | static HRESULT WINAPI |
| 58 | DirectDrawGammaControl_GetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) |
| 59 | { |
| 60 | ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawGammaControl, iface); |
| 61 | TRACE("(%p)->(%08lx,%p)\n", iface,dwFlags,lpGammaRamp); |
| 62 | return This->get_gamma_ramp(This, dwFlags, lpGammaRamp); |
| 63 | } |
| 64 | |
| 65 | static HRESULT WINAPI |
| 66 | DirectDrawGammaControl_SetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) |
| 67 | { |
| 68 | ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawGammaControl, iface); |
| 69 | TRACE("(%p)->(%08lx,%p)\n", iface,dwFlags,lpGammaRamp); |
| 70 | return This->set_gamma_ramp(This, dwFlags, lpGammaRamp); |
| 71 | } |
| 72 | |
| 73 | ICOM_VTABLE(IDirectDrawGammaControl) DDRAW_IDDGC_VTable = |
| 74 | { |
| 75 | DirectDrawGammaControl_QueryInterface, |
| 76 | DirectDrawGammaControl_AddRef, |
| 77 | DirectDrawGammaControl_Release, |
| 78 | DirectDrawGammaControl_GetGammaRamp, |
| 79 | DirectDrawGammaControl_SetGammaRamp |
| 80 | }; |