src/video/win32/SDL_win32gamma.c
author Edgar Simo <bobbens@gmail.com>
Sun, 06 Jul 2008 17:06:37 +0000
branchgsoc2008_force_feedback
changeset 2498 ab567bd667bf
parent 1895 c121d94672cb
child 2859 99210400e8b9
permissions -rw-r--r--
Fixed various mistakes in the doxygen.
slouken@1895
     1
/*
slouken@1895
     2
    SDL - Simple DirectMedia Layer
slouken@1895
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@1895
     4
slouken@1895
     5
    This library is free software; you can redistribute it and/or
slouken@1895
     6
    modify it under the terms of the GNU Lesser General Public
slouken@1895
     7
    License as published by the Free Software Foundation; either
slouken@1895
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@1895
     9
slouken@1895
    10
    This library is distributed in the hope that it will be useful,
slouken@1895
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@1895
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1895
    13
    Lesser General Public License for more details.
slouken@1895
    14
slouken@1895
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1895
    16
    License along with this library; if not, write to the Free Software
slouken@1895
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@1895
    18
slouken@1895
    19
    Sam Lantinga
slouken@1895
    20
    slouken@libsdl.org
slouken@1895
    21
*/
slouken@1895
    22
#include "SDL_config.h"
slouken@1895
    23
slouken@1895
    24
#include "SDL_win32video.h"
slouken@1895
    25
slouken@1895
    26
slouken@1895
    27
int
slouken@1895
    28
WIN_SetDisplayGammaRamp(_THIS, Uint16 * ramp)
slouken@1895
    29
{
slouken@1895
    30
    SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
slouken@1895
    31
    HDC hdc;
slouken@1895
    32
    BOOL succeeded = FALSE;
slouken@1895
    33
slouken@1895
    34
    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
slouken@1895
    35
    if (hdc) {
slouken@1895
    36
        succeeded = SetDeviceGammaRamp(hdc, ramp);
slouken@1895
    37
        if (!succeeded) {
slouken@1895
    38
            WIN_SetError("SetDeviceGammaRamp()");
slouken@1895
    39
        }
slouken@1895
    40
        DeleteDC(hdc);
slouken@1895
    41
    }
slouken@1895
    42
    return succeeded ? 0 : -1;
slouken@1895
    43
}
slouken@1895
    44
slouken@1895
    45
int
slouken@1895
    46
WIN_GetDisplayGammaRamp(_THIS, Uint16 * ramp)
slouken@1895
    47
{
slouken@1895
    48
    SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
slouken@1895
    49
    HDC hdc;
slouken@1895
    50
    BOOL succeeded = FALSE;
slouken@1895
    51
slouken@1895
    52
    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
slouken@1895
    53
    if (hdc) {
slouken@1895
    54
        succeeded = GetDeviceGammaRamp(hdc, ramp);
slouken@1895
    55
        if (!succeeded) {
slouken@1895
    56
            WIN_SetError("GetDeviceGammaRamp()");
slouken@1895
    57
        }
slouken@1895
    58
        DeleteDC(hdc);
slouken@1895
    59
    }
slouken@1895
    60
    return succeeded ? 0 : -1;
slouken@1895
    61
}
slouken@1895
    62
slouken@1895
    63
/* vi: set ts=4 sw=4 expandtab: */