ManaPlus
Functions
renderers.cpp File Reference

(642df39)

#include "render/renderers.h"
#include "debug.h"

Go to the source code of this file.

Functions

static RenderType getDefault () A_CONST
 
RenderType intToRenderType (const int mode)
 

Function Documentation

◆ getDefault()

static RenderType getDefault ( )
static

Definition at line 27 of file renderers.cpp.

28 {
29 #ifdef USE_OPENGL
30 #ifdef ANDROID
31  return RENDER_GLES_OPENGL;
32 #else // ANDROID
33 
34  return RENDER_NORMAL_OPENGL;
35 #endif // ANDROID
36 #else // USE_OPENGL
37 
38  return RENDER_SOFTWARE;
39 #endif // USE_OPENGL
40 }

References RENDER_GLES_OPENGL, RENDER_NORMAL_OPENGL, and RENDER_SOFTWARE.

Referenced by intToRenderType().

◆ intToRenderType()

RenderType intToRenderType ( const int  mode)

Definition at line 42 of file renderers.cpp.

43 {
44 #ifdef __SWITCH__
45  return RENDER_GLES2_OPENGL;
46 #endif
47  if (mode < 0 || mode >= RENDER_LAST)
48  return getDefault();
49 
50  if (mode != RENDER_SOFTWARE
51 #if defined(USE_OPENGL)
52 
53 // with OpenGL start
54 #if defined(ANDROID)
55 
56 // with OpenGL + with ANDROID start
57 #if defined(USE_SDL2)
58  && mode != RENDER_GLES_OPENGL
59  && mode != RENDER_SDL2_DEFAULT)
60 #else // defined(USE_SDL2)
61 
62  && mode != RENDER_GLES_OPENGL)
63 #endif // defined(USE_SDL2)
64 // with OpenGL + with ANDROID end
65 
66 #elif defined(__native_client__)
67 
68 // with OpenGL + with nacl start
69 #if defined(USE_SDL2)
70  && mode != RENDER_SAFE_OPENGL
71  && mode != RENDER_GLES2_OPENGL
72  && mode != RENDER_SDL2_DEFAULT)
73 #else // defined(USE_SDL2)
74 
75  && mode != RENDER_SAFE_OPENGL
76  && mode != RENDER_GLES2_OPENGL)
77 #endif // defined(USE_SDL2)
78 // with OpenGL + with nacl end
79 
80 #else // defined(ANDROID)
81 
82 // with OpenGL + without ANDROID start
83 #if defined(USE_SDL2)
84  && mode != RENDER_NORMAL_OPENGL
85  && mode != RENDER_MODERN_OPENGL
86  && mode != RENDER_SAFE_OPENGL
87  && mode != RENDER_GLES_OPENGL
88  && mode != RENDER_GLES2_OPENGL
89  && mode != RENDER_SDL2_DEFAULT)
90 #else // defined(USE_SDL2)
91 
92  && mode != RENDER_NORMAL_OPENGL
93  && mode != RENDER_MODERN_OPENGL
94  && mode != RENDER_SAFE_OPENGL
95  && mode != RENDER_GLES_OPENGL
96  && mode != RENDER_GLES2_OPENGL)
97 #endif // defined(USE_SDL2)
98 // with OpenGL + without ANDROID end
99 
100 #endif // defined(ANDROID)
101 // with OpenGL end
102 
103 #else // defined(USE_OPENGL)
104 
105 // without OpenGL start
106 #if defined(USE_SDL2)
107  && mode != RENDER_SDL2_DEFAULT)
108 #elif !defined(USE_SDL2)
109  )
110 #endif // defined(USE_SDL2)
111 // without OpenGL end
112 
113 #endif // defined(USE_OPENGL)
114 
115  {
116  return getDefault();
117  }
118 
119  return static_cast<RenderType>(mode);
120 }

References getDefault(), RENDER_GLES2_OPENGL, RENDER_GLES_OPENGL, RENDER_LAST, RENDER_MODERN_OPENGL, RENDER_NORMAL_OPENGL, RENDER_SAFE_OPENGL, RENDER_SDL2_DEFAULT, and RENDER_SOFTWARE.

Referenced by Setup_Video::action(), Setup_Video::apply(), GraphicsManager::createRenderers(), GraphicsManager::initGraphics(), and ConfigManager::storeSafeParameters().

RenderType
RenderType
Definition: rendertype.h:24
RENDER_NORMAL_OPENGL
@ RENDER_NORMAL_OPENGL
Definition: rendertype.h:27
RENDER_GLES_OPENGL
@ RENDER_GLES_OPENGL
Definition: rendertype.h:29
RENDER_MODERN_OPENGL
@ RENDER_MODERN_OPENGL
Definition: rendertype.h:31
RENDER_LAST
@ RENDER_LAST
Definition: rendertype.h:34
RENDER_SDL2_DEFAULT
@ RENDER_SDL2_DEFAULT
Definition: rendertype.h:30
RENDER_SOFTWARE
@ RENDER_SOFTWARE
Definition: rendertype.h:26
RENDER_SAFE_OPENGL
@ RENDER_SAFE_OPENGL
Definition: rendertype.h:28
getDefault
static RenderType getDefault() A_CONST
Definition: renderers.cpp:27
RENDER_GLES2_OPENGL
@ RENDER_GLES2_OPENGL
Definition: rendertype.h:32