ManaPlus
Functions
renderers.cpp File Reference

(986a3bf)

#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 28 of file renderers.cpp.

29 {
30 #ifdef USE_OPENGL
31 #ifdef ANDROID
32  return RENDER_GLES_OPENGL;
33 #else // ANDROID
34 
35  return RENDER_NORMAL_OPENGL;
36 #endif // ANDROID
37 #else // USE_OPENGL
38 
39  return RENDER_SOFTWARE;
40 #endif // USE_OPENGL
41 }
@ RENDER_GLES_OPENGL
Definition: rendertype.h:30
@ RENDER_NORMAL_OPENGL
Definition: rendertype.h:28
@ RENDER_SOFTWARE
Definition: rendertype.h:27

References RENDER_GLES_OPENGL, RENDER_NORMAL_OPENGL, and RENDER_SOFTWARE.

Referenced by intToRenderType().

◆ intToRenderType()

RenderType intToRenderType ( const int  mode)

Definition at line 43 of file renderers.cpp.

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

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().