src/SDL_compat.c
changeset 5466 006883d5fa51
parent 5313 7a569d09a682
child 5485 4cf1ad60ad47
equal deleted inserted replaced
5465:46bd121b04a2 5466:006883d5fa51
  1700 }
  1700 }
  1701 
  1701 
  1702 int
  1702 int
  1703 SDL_SetGamma(float red, float green, float blue)
  1703 SDL_SetGamma(float red, float green, float blue)
  1704 {
  1704 {
  1705     SDL_Unsupported();
  1705     Uint16 red_ramp[256];
  1706     return -1;
  1706     Uint16 green_ramp[256];
       
  1707     Uint16 blue_ramp[256];
       
  1708 
       
  1709     SDL_CalculateGammaRamp(red, red_ramp);
       
  1710     if (green == red) {
       
  1711         SDL_memcpy(green_ramp, red_ramp, sizeof(red_ramp));
       
  1712     } else {
       
  1713         SDL_CalculateGammaRamp(green, green_ramp);
       
  1714     }
       
  1715     if (blue == red) {
       
  1716         SDL_memcpy(blue_ramp, red_ramp, sizeof(red_ramp));
       
  1717     } else {
       
  1718         SDL_CalculateGammaRamp(blue, blue_ramp);
       
  1719     }
       
  1720     return SDL_SetWindowGammaRamp(SDL_VideoWindow, red_ramp, green_ramp, blue_ramp);
  1707 }
  1721 }
  1708 
  1722 
  1709 int
  1723 int
  1710 SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue)
  1724 SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue)
  1711 {
  1725 {
  1712     SDL_Unsupported();
  1726     return SDL_SetWindowGammaRamp(SDL_VideoWindow, red, green, blue);
  1713     return -1;
       
  1714 }
  1727 }
  1715 
  1728 
  1716 int
  1729 int
  1717 SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue)
  1730 SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue)
  1718 {
  1731 {
  1719     SDL_Unsupported();
  1732     return SDL_GetWindowGammaRamp(SDL_VideoWindow, red, green, blue);
  1720     return -1;
       
  1721 }
  1733 }
  1722 
  1734 
  1723 int
  1735 int
  1724 SDL_EnableKeyRepeat(int delay, int interval)
  1736 SDL_EnableKeyRepeat(int delay, int interval)
  1725 {
  1737 {