summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorcpasjuste <cpasjuste@gmail.com>2020-04-22 15:24:08 +0200
committercpasjuste <cpasjuste@gmail.com>2020-04-22 15:24:08 +0200
commitf43e3aa48aeb561f5c7e85f1b7121aab6a61decd (patch)
tree1c23a1e1db2676c27a99b6385f0580442b29f7a0 /src/render
parentb0c696eaab501391512b08826c3c9a52023e2be7 (diff)
downloadmanaplus-f43e3aa48aeb561f5c7e85f1b7121aab6a61decd.tar.gz
manaplus-f43e3aa48aeb561f5c7e85f1b7121aab6a61decd.tar.bz2
manaplus-f43e3aa48aeb561f5c7e85f1b7121aab6a61decd.tar.xz
manaplus-f43e3aa48aeb561f5c7e85f1b7121aab6a61decd.zip
switch: first commit
Diffstat (limited to 'src/render')
-rw-r--r--src/render/renderers.cpp3
-rw-r--r--src/render/rendererslistsdl2.h33
2 files changed, 36 insertions, 0 deletions
diff --git a/src/render/renderers.cpp b/src/render/renderers.cpp
index c81ac9b57..efcad9ff2 100644
--- a/src/render/renderers.cpp
+++ b/src/render/renderers.cpp
@@ -41,6 +41,9 @@ static RenderType getDefault() noexcept2
RenderType intToRenderType(const int mode) noexcept2
{
+#ifdef __SWITCH__
+ return RENDER_SDL2_DEFAULT;
+#endif
if (mode < 0 || mode >= RENDER_LAST)
return getDefault();
diff --git a/src/render/rendererslistsdl2.h b/src/render/rendererslistsdl2.h
index 60202c2dd..b13324b2d 100644
--- a/src/render/rendererslistsdl2.h
+++ b/src/render/rendererslistsdl2.h
@@ -99,6 +99,39 @@ const int renderToIndex[] =
3 // RENDER_GLES2_OPENGL
};
+#elif defined(__SWITCH__)
+
+// map for index to RenderType
+const RenderType indexToRender[] =
+{
+ RENDER_SOFTWARE,
+ RENDER_SDL2_DEFAULT,
+ RENDER_MODERN_OPENGL
+};
+
+const char *OPENGL_NAME[] =
+{
+ // TRANSLATORS: draw backend
+ N_("Software"),
+ // TRANSLATORS: draw backend
+ N_("SDL2 default"),
+ // TRANSLATORS: draw backend
+ N_("Modern OpenGL")
+};
+
+const int renderModesListSize = 3;
+
+const int renderToIndex[] =
+{
+ 2, // RENDER_SOFTWARE
+ 2, // RENDER_NORMAL_OPENGL
+ 2, // RENDER_SAFE_OPENGL
+ 2, // RENDER_GLES_OPENGL
+ 1, // RENDER_SDL2_DEFAULT
+ 2, // RENDER_MODERN_OPENGL
+ 2 // RENDER_GLES2_OPENGL
+};
+
#else // ANDROID or nacl
// defined OPENGL