summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/graphics.cpp4
-rw-r--r--src/render/mobileopenglgraphics.cpp2
-rw-r--r--src/render/mobileopenglgraphics.h2
-rw-r--r--src/render/modernopenglgraphics.cpp2
-rw-r--r--src/render/modernopenglgraphics.h2
-rw-r--r--src/render/normalopenglgraphics.cpp2
-rw-r--r--src/render/normalopenglgraphics.h2
-rw-r--r--src/render/opengl/mglfunctions.h2
-rw-r--r--src/render/renderers.cpp2
-rw-r--r--src/render/rendererslistsdl2.h6
-rw-r--r--src/render/safeopenglgraphics.cpp2
-rw-r--r--src/render/safeopenglgraphics.h2
12 files changed, 16 insertions, 14 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index cd88c25dd..ecc31f8f9 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -360,7 +360,7 @@ bool Graphics::setOpenGLMode() restrict2
OpenGLImageHelper::mTextureSize = texSize;
logger->log("OpenGL texture size: %d pixels (rectangle textures)",
OpenGLImageHelper::mTextureSize);
-#ifndef ANDROID
+#if !defined(ANDROID) && !defined(__SWITCH__)
SafeOpenGLImageHelper::mTextureType = GL_TEXTURE_RECTANGLE_ARB;
SafeOpenGLImageHelper::mTextureSize = texSize;
#endif // ANDROID
@@ -370,7 +370,7 @@ bool Graphics::setOpenGLMode() restrict2
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);
OpenGLImageHelper::mTextureType = GL_TEXTURE_2D;
OpenGLImageHelper::mTextureSize = texSize;
-#ifndef ANDROID
+#if !defined(ANDROID) && !defined(__SWITCH__)
SafeOpenGLImageHelper::mTextureType = GL_TEXTURE_2D;
SafeOpenGLImageHelper::mTextureSize = texSize;
#endif // ANDROID
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index 250cd8969..935833e0b 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if defined(USE_OPENGL) && !defined(__native_client__)
+#if defined(USE_OPENGL) && !defined(__native_client__) && !defined(__SWITCH__)
#include "render/mobileopenglgraphics.h"
diff --git a/src/render/mobileopenglgraphics.h b/src/render/mobileopenglgraphics.h
index 5cf018692..0496de283 100644
--- a/src/render/mobileopenglgraphics.h
+++ b/src/render/mobileopenglgraphics.h
@@ -23,7 +23,7 @@
#ifndef RENDER_MOBILEOPENGLGRAPHICS_H
#define RENDER_MOBILEOPENGLGRAPHICS_H
-#if defined(USE_OPENGL) && !defined(__native_client__)
+#if defined(USE_OPENGL) && !defined(__native_client__) && !defined(__SWITCH__)
#include "localconsts.h"
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index 937255c0e..15bb1505c 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if defined(USE_OPENGL) && !defined(ANDROID) && !defined(__native_client__)
+#if defined(USE_OPENGL) && !defined(ANDROID) && !defined(__native_client__) && !defined(__SWITCH__)
#include "render/modernopenglgraphics.h"
diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h
index 087dbd95d..5c3e643ab 100644
--- a/src/render/modernopenglgraphics.h
+++ b/src/render/modernopenglgraphics.h
@@ -23,7 +23,7 @@
#ifndef RENDER_MODERNOPENGLGRAPHICS_H
#define RENDER_MODERNOPENGLGRAPHICS_H
-#if defined(USE_OPENGL) && !defined(ANDROID) && !defined(__native_client__)
+#if defined(USE_OPENGL) && !defined(ANDROID) && !defined(__native_client__) && !defined(__SWITCH__)
#include "localconsts.h"
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index 87b6a8a2a..666ef9ef4 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if defined(USE_OPENGL) && !defined(ANDROID) && !defined(__native_client__)
+#if defined(USE_OPENGL) && !defined(ANDROID) && !defined(__native_client__) && !defined(__SWITCH__)
#include "render/normalopenglgraphics.h"
diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h
index c7866dc50..535d97f8e 100644
--- a/src/render/normalopenglgraphics.h
+++ b/src/render/normalopenglgraphics.h
@@ -23,7 +23,7 @@
#ifndef RENDER_NORMALOPENGLGRAPHICS_H
#define RENDER_NORMALOPENGLGRAPHICS_H
-#if defined USE_OPENGL && !defined ANDROID && !defined(__native_client__)
+#if defined USE_OPENGL && !defined ANDROID && !defined(__native_client__) && !defined(__SWITCH__)
#include "localconsts.h"
diff --git a/src/render/opengl/mglfunctions.h b/src/render/opengl/mglfunctions.h
index 11b387fdb..1126b48bb 100644
--- a/src/render/opengl/mglfunctions.h
+++ b/src/render/opengl/mglfunctions.h
@@ -35,6 +35,8 @@ LOGGER_H
#define getFunction(name) nullptr
#elif defined __native_client__
#define getFunction(name) glGetProcAddressREGAL(name)
+#elif defined(__SWITCH__)
+#define getFunction(name) SDL_GL_GetProcAddress(name)
#else // WIN32
#define getFunction(name) glXGetProcAddress(\
reinterpret_cast<const GLubyte*>(name))
diff --git a/src/render/renderers.cpp b/src/render/renderers.cpp
index efcad9ff2..40bb550bc 100644
--- a/src/render/renderers.cpp
+++ b/src/render/renderers.cpp
@@ -42,7 +42,7 @@ static RenderType getDefault() noexcept2
RenderType intToRenderType(const int mode) noexcept2
{
#ifdef __SWITCH__
- return RENDER_SDL2_DEFAULT;
+ return RENDER_GLES2_OPENGL;
#endif
if (mode < 0 || mode >= RENDER_LAST)
return getDefault();
diff --git a/src/render/rendererslistsdl2.h b/src/render/rendererslistsdl2.h
index b13324b2d..259643295 100644
--- a/src/render/rendererslistsdl2.h
+++ b/src/render/rendererslistsdl2.h
@@ -106,7 +106,7 @@ const RenderType indexToRender[] =
{
RENDER_SOFTWARE,
RENDER_SDL2_DEFAULT,
- RENDER_MODERN_OPENGL
+ RENDER_GLES2_OPENGL
};
const char *OPENGL_NAME[] =
@@ -116,14 +116,14 @@ const char *OPENGL_NAME[] =
// TRANSLATORS: draw backend
N_("SDL2 default"),
// TRANSLATORS: draw backend
- N_("Modern OpenGL")
+ N_("OpenGL ES 2")
};
const int renderModesListSize = 3;
const int renderToIndex[] =
{
- 2, // RENDER_SOFTWARE
+ 0, // RENDER_SOFTWARE
2, // RENDER_NORMAL_OPENGL
2, // RENDER_SAFE_OPENGL
2, // RENDER_GLES_OPENGL
diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp
index 329ad34cb..8583ed6b5 100644
--- a/src/render/safeopenglgraphics.cpp
+++ b/src/render/safeopenglgraphics.cpp
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if defined USE_OPENGL && !defined ANDROID
+#if defined USE_OPENGL && !defined ANDROID && !defined(__SWITCH__)
#include "render/safeopenglgraphics.h"
#ifdef DEBUG_OPENGL
diff --git a/src/render/safeopenglgraphics.h b/src/render/safeopenglgraphics.h
index a064da020..55a1c8515 100644
--- a/src/render/safeopenglgraphics.h
+++ b/src/render/safeopenglgraphics.h
@@ -23,7 +23,7 @@
#ifndef RENDER_SAFEOPENGLGRAPHICS_H
#define RENDER_SAFEOPENGLGRAPHICS_H
-#if defined USE_OPENGL && !defined ANDROID
+#if defined USE_OPENGL && !defined ANDROID && !defined(__SWITCH__)
#include "render/graphics.h"