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