SDL_Compat.h 671 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. /*
  3. * SDL_Compat.h, part of VCMI engine
  4. *
  5. * Authors: listed in file AUTHORS in main folder
  6. *
  7. * License: GNU General Public License v2.0 or later
  8. * Full text of license available in license.txt file, in main folder
  9. *
  10. */
  11. #include <SDL_version.h>
  12. #if (SDL_MAJOR_VERSION == 2)
  13. #define VCMI_SDL2
  14. #include <SDL_keycode.h>
  15. typedef int SDLX_Coord;
  16. typedef int SDLX_Size;
  17. typedef SDL_Keycode SDLKey;
  18. #define SDL_SRCCOLORKEY SDL_TRUE
  19. #define SDL_FULLSCREEN SDL_WINDOW_FULLSCREEN
  20. #elif (SDL_MAJOR_VERSION == 1)
  21. #define VCMI_SDL1
  22. //SDL 1.x
  23. typedef Sint16 SDLX_Coord;
  24. typedef Uint16 SDLX_Size;
  25. #else
  26. #error "unknown or unsupported SDL version"
  27. #endif