ManaPlus
nullopenglgraphics.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2018 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef RENDER_NULLOPENGLGRAPHICS_H
24 #define RENDER_NULLOPENGLGRAPHICS_H
25 
26 #if defined USE_OPENGL
27 
28 #include "localconsts.h"
29 
30 #include "render/graphics.h"
31 
32 #include "resources/fboinfo.h"
33 
34 #ifdef ANDROID
35 #include <GLES/gl.h>
36 #include <GLES/glext.h>
37 #include <GLES2/gl2.h>
38 #else // ANDROID
39 #ifndef USE_SDL2
40 #define GL_GLEXT_PROTOTYPES 1
41 #endif // USE_SDL2
42 PRAGMA48(GCC diagnostic push)
43 PRAGMA48(GCC diagnostic ignored "-Wshadow")
44 #include <SDL_opengl.h>
45 PRAGMA48(GCC diagnostic pop)
46 #if defined(__APPLE__)
47 #include <OpenGL/glext.h>
48 #elif !defined(__native_client__)
49 #include <GL/glext.h>
50 #endif // defined(__APPLE__)
51 #endif // ANDROID
52 
54 
56 {
57  public:
59 
61 
62  ~NullOpenGLGraphics() override final;
63 
64  inline void drawQuadArrayfi(const int size) restrict2 A_INLINE;
65 
66  inline void drawQuadArrayfi(const GLint *restrict const intVertArray,
67  const GLfloat *restrict const
68  floatTexArray,
69  const int size) restrict2 A_INLINE;
70 
71  inline void drawQuadArrayii(const int size) restrict2 A_INLINE;
72 
73  inline void drawQuadArrayii(const GLint *restrict const intVertArray,
74  const GLint *restrict const intTexArray,
75  const int size) restrict2 A_INLINE;
76 
77  inline void drawLineArrayi(const int size) restrict2 A_INLINE;
78 
79  inline void drawLineArrayf(const int size) restrict2 A_INLINE;
80 
81  #include "render/graphicsdef.hpp"
83 
86 
89 
92 
93  private:
97  bool mTexture;
98 
101  float mFloatColor;
104 #ifdef DEBUG_BIND_TEXTURE
105  std::string mOldTexture;
106  unsigned mOldTextureId;
107 #endif // DEBUG_BIND_TEXTURE
109 };
110 #endif // defined USE_OPENGL
111 #endif // RENDER_NULLOPENGLGRAPHICS_H
#define A_DELETE_COPY(func)
Definition: localconsts.h:52
#define A_NONNULLPOINTER
Definition: localconsts.h:257
#define RENDER_OPENGLGRAPHICSDEF_HPP
void drawQuadArrayii(const int size) A_INLINE
#define final
Definition: localconsts.h:45
void drawLineArrayi(const int size) A_INLINE
void drawQuadArrayfi(const int size) A_INLINE
#define RENDER_OPENGLGRAPHICSDEF1_HPP
void drawLineArrayf(const int size) A_INLINE
#define PRAGMA48(str)
Definition: localconsts.h:190
#define RENDER_OPENGLGRAPHICSDEFADVANCED_HPP
#define RENDER_GRAPHICSDEF_HPP
Definition: color.h:74
#define restrict
Definition: localconsts.h:156
#define restrict2
Definition: localconsts.h:157