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-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef RENDER_NULLOPENGLGRAPHICS_H
25 #define RENDER_NULLOPENGLGRAPHICS_H
26 
27 #if defined USE_OPENGL
28 
29 #include "localconsts.h"
30 
31 #include "render/graphics.h"
32 
33 #include "resources/fboinfo.h"
34 
35 #ifdef ANDROID
36 #include <GLES/gl.h>
37 #include <GLES/glext.h>
38 #include <GLES2/gl2.h>
39 #else // ANDROID
40 #ifndef USE_SDL2
41 #define GL_GLEXT_PROTOTYPES 1
42 #endif // USE_SDL2
43 PRAGMA48(GCC diagnostic push)
44 PRAGMA48(GCC diagnostic ignored "-Wshadow")
45 // ignore -Wredundant-decls for SDL 1.2
46 PRAGMA45(GCC diagnostic push)
47 PRAGMA45(GCC diagnostic ignored "-Wredundant-decls")
48 #include <SDL_opengl.h>
49 PRAGMA45(GCC diagnostic pop)
50 PRAGMA48(GCC diagnostic pop)
51 #if defined(__APPLE__)
52 #include <OpenGL/glext.h>
53 #elif !defined(__native_client__)
54 PRAGMA45(GCC diagnostic push)
55 PRAGMA45(GCC diagnostic ignored "-Wredundant-decls")
56 #include <GL/glext.h>
57 PRAGMA45(GCC diagnostic pop)
58 #endif // defined(__APPLE__)
59 #endif // ANDROID
60 
61 class OpenGLGraphicsVertexes;
62 
64 {
65  public:
67 
69 
70  ~NullOpenGLGraphics() override final;
71 
72  inline void drawQuadArrayfi(const int size) restrict2 A_INLINE;
73 
74  inline void drawQuadArrayfi(const GLint *restrict const intVertArray,
75  const GLfloat *restrict const
76  floatTexArray,
77  const int size) restrict2 A_INLINE;
78 
79  inline void drawQuadArrayii(const int size) restrict2 A_INLINE;
80 
81  inline void drawQuadArrayii(const GLint *restrict const intVertArray,
82  const GLint *restrict const intTexArray,
83  const int size) restrict2 A_INLINE;
84 
85  inline void drawLineArrayi(const int size) restrict2 A_INLINE;
86 
87  inline void drawLineArrayf(const int size) restrict2 A_INLINE;
88 
89  #include "render/graphicsdef.hpp"
91 
94 
97 
100 
101  private:
105  bool mTexture;
106 
109  float mFloatColor;
112 #ifdef DEBUG_BIND_TEXTURE
113  std::string mOldTexture;
114  unsigned mOldTextureId;
115 #endif // DEBUG_BIND_TEXTURE
116  FBOInfo mFbo;
117 };
118 #endif // defined USE_OPENGL
119 #endif // RENDER_NULLOPENGLGRAPHICS_H
Definition: color.h:76
void drawLineArrayf(const int size) A_INLINE
void drawQuadArrayfi(const int size) A_INLINE
void drawLineArrayi(const int size) A_INLINE
void drawQuadArrayii(const int size) A_INLINE
#define RENDER_GRAPHICSDEF_HPP
Definition: graphicsdef.hpp:24
#define restrict
Definition: localconsts.h:165
#define restrict2
Definition: localconsts.h:166
#define A_NONNULLPOINTER
Definition: localconsts.h:266
#define final
Definition: localconsts.h:46
#define PRAGMA48(str)
Definition: localconsts.h:199
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
int size()
Definition: emotedb.cpp:306
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) class OpenGLGraphicsVertexes
#define RENDER_OPENGLGRAPHICSDEF1_HPP
#define RENDER_OPENGLGRAPHICSDEF_HPP
#define RENDER_OPENGLGRAPHICSDEFADVANCED_HPP