3
* Copyright (C) 2013 The ManaPlus Developers
5
* This file is part of The ManaPlus Client.
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
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.
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/>.
21
#include "render/renderers.h"
23
static RenderType getDefault()
27
return RENDER_GLES_OPENGL;
29
return RENDER_NORMAL_OPENGL;
32
return RENDER_SOFTWARE;
36
RenderType intToRenderType(const int mode)
38
if (mode < 0 || mode >= RENDER_LAST)
41
if (mode != RENDER_SOFTWARE
42
#if defined(USE_OPENGL) && defined(ANDROID) && defined(USE_SDL2)
43
&& mode != RENDER_GLES_OPENGL && mode != RENDER_SDL2_DEFAULT)
44
#elif defined(USE_OPENGL) && defined(ANDROID) && !defined(USE_SDL2)
45
&& mode != RENDER_GLES_OPENGL)
46
#elif defined(USE_OPENGL) && !defined(ANDROID) && defined(USE_SDL2)
47
&& mode != RENDER_NORMAL_OPENGL && mode != RENDER_SAFE_OPENGL
48
&& mode != RENDER_GLES_OPENGL && mode != RENDER_SDL2_DEFAULT)
49
#elif !defined(USE_OPENGL) && defined(USE_SDL2)
50
&& mode != RENDER_SDL2_DEFAULT)
51
#elif !defined(USE_OPENGL) && !defined(USE_SDL2)
53
#elif defined(USE_OPENGL) && !defined(ANDROID) && !defined(USE_SDL2)
54
&& mode != RENDER_NORMAL_OPENGL && mode != RENDER_SAFE_OPENGL
55
&& mode != RENDER_GLES_OPENGL)
61
return static_cast<RenderType>(mode);