ManaPlus
Macros | Functions
renderers.h File Reference

(986a3bf)

#include "enums/render/rendertype.h"
#include "localconsts.h"

Go to the source code of this file.

Macros

#define isBatchDrawRenders(val)   ((val) != RENDER_SAFE_OPENGL)
 

Functions

RenderType intToRenderType (const int mode) A_CONST
 

Macro Definition Documentation

◆ isBatchDrawRenders

#define isBatchDrawRenders (   val)    ((val) != RENDER_SAFE_OPENGL)

Definition at line 31 of file renderers.h.

Function Documentation

◆ 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_GLES_OPENGL
Definition: rendertype.h:30
@ RENDER_MODERN_OPENGL
Definition: rendertype.h:32
@ RENDER_LAST
Definition: rendertype.h:35
@ RENDER_NORMAL_OPENGL
Definition: rendertype.h:28
@ RENDER_SDL2_DEFAULT
Definition: rendertype.h:31
@ RENDER_SOFTWARE
Definition: rendertype.h:27

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