src/video/windows/SDL_windowsgamma.c
author Sam Lantinga
Tue, 08 Feb 2011 16:50:51 -0800
changeset 5229 c015d3e63631
parent 5062 e8916fe9cfc8
permissions -rw-r--r--
Fixed setting the texture unit, still doesn't work.
slouken@1895
     1
/*
slouken@1895
     2
    SDL - Simple DirectMedia Layer
slouken@3697
     3
    Copyright (C) 1997-2010 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@5062
    24
#include "SDL_windowsvideo.h"
slouken@1895
    25
slouken@1895
    26
slouken@1895
    27
int
slouken@3500
    28
WIN_SetDisplayGammaRamp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp)
slouken@1895
    29
{
slouken@3097
    30
#ifdef _WIN32_WCE
slouken@3139
    31
    return -1;
slouken@3097
    32
#else
slouken@3500
    33
    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
slouken@1895
    34
    HDC hdc;
slouken@1895
    35
    BOOL succeeded = FALSE;
slouken@1895
    36
slouken@1895
    37
    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
slouken@1895
    38
    if (hdc) {
slouken@1895
    39
        succeeded = SetDeviceGammaRamp(hdc, ramp);
slouken@1895
    40
        if (!succeeded) {
slouken@1895
    41
            WIN_SetError("SetDeviceGammaRamp()");
slouken@1895
    42
        }
slouken@1895
    43
        DeleteDC(hdc);
slouken@1895
    44
    }
slouken@1895
    45
    return succeeded ? 0 : -1;
slouken@3097
    46
#endif
slouken@1895
    47
}
slouken@1895
    48
slouken@1895
    49
int
slouken@3500
    50
WIN_GetDisplayGammaRamp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp)
slouken@1895
    51
{
slouken@3097
    52
#ifdef _WIN32_WCE
slouken@3139
    53
    return -1;
slouken@3097
    54
#else
slouken@3500
    55
    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
slouken@1895
    56
    HDC hdc;
slouken@1895
    57
    BOOL succeeded = FALSE;
slouken@1895
    58
slouken@1895
    59
    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
slouken@1895
    60
    if (hdc) {
slouken@1895
    61
        succeeded = GetDeviceGammaRamp(hdc, ramp);
slouken@1895
    62
        if (!succeeded) {
slouken@1895
    63
            WIN_SetError("GetDeviceGammaRamp()");
slouken@1895
    64
        }
slouken@1895
    65
        DeleteDC(hdc);
slouken@1895
    66
    }
slouken@1895
    67
    return succeeded ? 0 : -1;
slouken@3097
    68
#endif
slouken@1895
    69
}
slouken@1895
    70
slouken@1895
    71
/* vi: set ts=4 sw=4 expandtab: */