1 /*
2  *  The ManaPlus Client
3  *  Copyright (C) 2013-2019  The ManaPlus Developers
4  *  Copyright (C) 2019-2021  Andrei Karas
5  *
6  *  This file is part of The ManaPlus Client.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef SDLSHARED_H
23 #define SDLSHARED_H
24 
25 #ifdef USE_SDL2
26 
27 #define SDL_GetKeyState SDL_GetKeyboardState
28 #define SDLKey SDL_Scancode
29 #define SDL_keysym SDL_Keysym
30 
31 #define SDL_ANYFORMAT 0
32 #define SDL_HWSURFACE 0
33 #define SDL_NOFRAME SDL_WINDOW_BORDERLESS
34 #define SDL_RESIZABLE SDL_WINDOW_RESIZABLE
35 #define SDL_FULLSCREEN SDL_WINDOW_FULLSCREEN
36 #define SDL_OPENGL SDL_WINDOW_OPENGL
37 
38 #define KMOD_META KMOD_GUI
39 #define SDLK_RMETA SDLK_RGUI
40 #define SDLK_LMETA SDLK_LGUI
41 #define SDLK_KP0 SDLK_KP_0
42 #define SDLK_KP1 SDLK_KP_1
43 #define SDLK_KP2 SDLK_KP_2
44 #define SDLK_KP3 SDLK_KP_3
45 #define SDLK_KP4 SDLK_KP_4
46 #define SDLK_KP5 SDLK_KP_5
47 #define SDLK_KP6 SDLK_KP_6
48 #define SDLK_KP7 SDLK_KP_7
49 #define SDLK_KP8 SDLK_KP_8
50 #define SDLK_KP9 SDLK_KP_9
51 #define SDLK_PRINT SDLK_PRINTSCREEN
52 #define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
53 #define SDLK_SCROLLOCK SDLK_SCROLLLOCK
54 #define SDLK_LAST SDL_NUM_SCANCODES
55 
56 #define SDL_DEFAULT_REPEAT_DELAY 500
57 
58 #else  // USE_SDL2
59 
60 #define SDL_Window SDL_Surface
61 #define SDL_JoystickNameForIndex SDL_JoystickName
62 #define SurfaceImageHelper SDLImageHelper
63 #define SDL_GLContext (void*)
64 
65 #endif  // USE_SDL2
66 
67 #endif  // SDLSHARED_H
68