summaryrefslogtreecommitdiff
path: root/src/sdlshared.h
blob: 2dec6aada6f44ff8b2091ab9d634c7f6cf488247 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 *  The ManaPlus Client
 *  Copyright (C) 2013-2017  The ManaPlus Developers
 *
 *  This file is part of The ManaPlus Client.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef SDLSHARED_H
#define SDLSHARED_H

#ifdef USE_SDL2

#define SDL_GetKeyState SDL_GetKeyboardState
#define SDLKey SDL_Scancode
#define SDL_keysym SDL_Keysym

#define SDL_ANYFORMAT 0
#define SDL_HWSURFACE 0
#define SDL_NOFRAME SDL_WINDOW_BORDERLESS
#define SDL_RESIZABLE SDL_WINDOW_RESIZABLE
#define SDL_FULLSCREEN SDL_WINDOW_FULLSCREEN
#define SDL_OPENGL SDL_WINDOW_OPENGL

#define KMOD_META KMOD_GUI
#define SDLK_RMETA SDLK_RGUI
#define SDLK_LMETA SDLK_LGUI
#define SDLK_KP0 SDLK_KP_0
#define SDLK_KP1 SDLK_KP_1
#define SDLK_KP2 SDLK_KP_2
#define SDLK_KP3 SDLK_KP_3
#define SDLK_KP4 SDLK_KP_4
#define SDLK_KP5 SDLK_KP_5
#define SDLK_KP6 SDLK_KP_6
#define SDLK_KP7 SDLK_KP_7
#define SDLK_KP8 SDLK_KP_8
#define SDLK_KP9 SDLK_KP_9
#define SDLK_PRINT SDLK_PRINTSCREEN
#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
#define SDLK_LAST SDL_NUM_SCANCODES

#define SDL_DEFAULT_REPEAT_DELAY 500

#else  // USE_SDL2

#define SDL_Window SDL_Surface
#define SDL_JoystickNameForIndex SDL_JoystickName
#define SurfaceImageHelper SDLImageHelper
#define SDL_WaitEventTimeout(event, time) SDL_PollEvent(event)
#define SDL_GLContext (void*)

#endif  // USE_SDL2

#endif  // SDLSHARED_H