ManaPlus
rendererslistsdl2.h
Go to the documentation of this file.
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 RENDER_RENDERERSLISTSDL2_H
23 #define RENDER_RENDERERSLISTSDL2_H
24 
25 #ifdef USE_SDL2
26 
27 #include "utils/gettext.h"
28 
29 #include "render/renderers.h"
30 
31 #ifdef USE_OPENGL
32 #ifdef ANDROID
33 // defined OPENGL ANDROID
34 
35 // map for index to RenderType
36 const RenderType indexToRender[] =
37 {
41 };
42 
43 const char *OPENGL_NAME[] =
44 {
45  // TRANSLATORS: draw backend
46  N_("Software"),
47  // TRANSLATORS: draw backend
48  N_("SDL2 default"),
49  // TRANSLATORS: draw backend
50  N_("Mobile OpenGL ES")
51 };
52 
53 const int renderModesListSize = 3;
54 
55 const int renderToIndex[] =
56 {
57  0, // RENDER_SOFTWARE
58  2, // RENDER_NORMAL_OPENGL
59  2, // RENDER_SAFE_OPENGL
60  2, // RENDER_GLES_OPENGL
61  1, // RENDER_SDL2_DEFAULT
62  2, // RENDER_MODERN_OPENGL
63  2 // RENDER_GLES_OPENGL
64 };
65 
66 #elif defined(__native_client__)
67 // defined OPENGL nacl
68 
69 // map for index to RenderType
70 const RenderType indexToRender[] =
71 {
76 };
77 
78 const char *OPENGL_NAME[] =
79 {
80  // TRANSLATORS: draw backend
81  N_("Software"),
82  // TRANSLATORS: draw backend
83  N_("SDL2 default"),
84  // TRANSLATORS: draw backend
85  N_("Safe OpenGL"),
86  // TRANSLATORS: draw backend
87  N_("Mobile OpenGL ES 2")
88 };
89 
90 const int renderModesListSize = 4;
91 
92 const int renderToIndex[] =
93 {
94  0, // RENDER_SOFTWARE
95  3, // RENDER_NORMAL_OPENGL
96  2, // RENDER_SAFE_OPENGL
97  3, // RENDER_GLES_OPENGL
98  1, // RENDER_SDL2_DEFAULT
99  3, // RENDER_MODERN_OPENGL
100  3 // RENDER_GLES2_OPENGL
101 };
102 
103 #elif defined(__SWITCH__)
104 
105 // map for index to RenderType
106 const RenderType indexToRender[] =
107 {
109 };
110 
111 const char *OPENGL_NAME[] =
112 {
113  // TRANSLATORS: draw backend
114  N_("OpenGL ES 2")
115 };
116 
117 const int renderModesListSize = 1;
118 
119 const int renderToIndex[] =
120 {
121  0, // RENDER_SOFTWARE
122  0, // RENDER_NORMAL_OPENGL
123  0, // RENDER_SAFE_OPENGL
124  0, // RENDER_GLES_OPENGL
125  0, // RENDER_SDL2_DEFAULT
126  0, // RENDER_MODERN_OPENGL
127  0 // RENDER_GLES2_OPENGL
128 };
129 
130 #else // ANDROID or nacl
131 // defined OPENGL
132 
133 // map for index to RenderType
134 const RenderType indexToRender[] =
135 {
143 };
144 
145 const char *OPENGL_NAME[] =
146 {
147  // TRANSLATORS: draw backend
148  N_("Software"),
149  // TRANSLATORS: draw backend
150  N_("SDL2 default"),
151  // TRANSLATORS: draw backend
152  N_("Normal OpenGL"),
153  // TRANSLATORS: draw backend
154  N_("Safe OpenGL"),
155  // TRANSLATORS: draw backend
156  N_("Mobile OpenGL ES"),
157  // TRANSLATORS: draw backend
158  N_("Modern OpenGL"),
159  // TRANSLATORS: draw backend
160  N_("Mobile OpenGL ES 2")
161 };
162 
163 const int renderModesListSize = 7;
164 
165 const int renderToIndex[] =
166 {
167  0, // RENDER_SOFTWARE
168  2, // RENDER_NORMAL_OPENGL
169  3, // RENDER_SAFE_OPENGL
170  4, // RENDER_GLES_OPENGL
171  1, // RENDER_SDL2_DEFAULT
172  5, // RENDER_MODERN_OPENGL
173  6 // RENDER_GLES2_OPENGL
174 };
175 
176 #endif // ANDROID
177 
178 #else // USE_OPENGL
179 // no defines
180 
181 // map for index to RenderType
182 const RenderType indexToRender[] =
183 {
186 };
187 
188 const char *OPENGL_NAME[] =
189 {
190  // TRANSLATORS: draw backend
191  N_("Software"),
192  // TRANSLATORS: draw backend
193  N_("SDL2 default")
194 };
195 
196 const int renderModesListSize = 2;
197 
198 const int renderToIndex[] =
199 {
200  0, // RENDER_SOFTWARE
201  0, // RENDER_NORMAL_OPENGL
202  0, // RENDER_SAFE_OPENGL
203  0, // RENDER_GLES_OPENGL
204  1, // RENDER_SDL2_DEFAULT
205  0, // RENDER_MODERN_OPENGL
206  0 // RENDER_GLES2_OPENGL
207 };
208 
209 #endif // USE_OPENGL
210 
211 #endif // USE_SDL2
212 #endif // RENDER_RENDERERSLISTSDL2_H
#define N_(s)
Definition: gettext.h:36
const int renderToIndex[]
const int renderModesListSize
const char * OPENGL_NAME[]
const RenderType indexToRender[]
RenderType
Definition: rendertype.h:26
@ RENDER_SAFE_OPENGL
Definition: rendertype.h:29
@ RENDER_GLES2_OPENGL
Definition: rendertype.h:33
@ RENDER_GLES_OPENGL
Definition: rendertype.h:30
@ RENDER_MODERN_OPENGL
Definition: rendertype.h:32
@ RENDER_NORMAL_OPENGL
Definition: rendertype.h:28
@ RENDER_SDL2_DEFAULT
Definition: rendertype.h:31
@ RENDER_SOFTWARE
Definition: rendertype.h:27