ManaPlus
mobileopenglgraphics.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_MOBILEOPENGLGRAPHICS_H
25 #define RENDER_MOBILEOPENGLGRAPHICS_H
26 
27 #if defined(USE_OPENGL) && !defined(__native_client__) && !defined(__SWITCH__)
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  ~MobileOpenGLGraphics() override final;
71 
72  void postInit() restrict2 override final;
73 
74  inline void drawTriangleArrayfs(const GLshort *restrict const
75  shortVertArray,
76  const GLfloat *restrict const
77  floatTexArray,
78  const int size) restrict2 A_INLINE;
79 
80  inline void drawTriangleArrayfs(const int size) restrict2 A_INLINE;
81 
82  inline void drawTriangleArrayfsCached(const int size)
83  restrict2 A_INLINE;
84 
85  inline void drawLineArrays(const int size) restrict2 A_INLINE;
86 
87  #include "render/graphicsdef.hpp"
89 
92 
95 
98 
99  private:
100  GLfloat *mFloatTexArray;
101  GLshort *mShortVertArray;
106  bool mTexture;
107 
110  GLuint mImageCached;
111  float mFloatColor;
114 #ifdef DEBUG_BIND_TEXTURE
115  std::string mOldTexture;
116  unsigned mOldTextureId;
117 #endif // DEBUG_BIND_TEXTURE
118 
119  FBOInfo mFbo;
120 };
121 #endif // defined(USE_OPENGL) && !defined(__native_client__)
122 
123 #endif // RENDER_MOBILEOPENGLGRAPHICS_H
Definition: color.h:76
void drawLineArrays(const int size) A_INLINE
void drawTriangleArrayfs(const GLshort *const shortVertArray, const GLfloat *const floatTexArray, const int size) A_INLINE
void drawTriangleArrayfsCached(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 final
Definition: localconsts.h:46
#define PRAGMA48(str)
Definition: localconsts.h:199
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
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
int size()
Definition: emotedb.cpp:306
#define RENDER_OPENGLGRAPHICSDEF1_HPP
#define RENDER_OPENGLGRAPHICSDEF_HPP
#define RENDER_OPENGLGRAPHICSDEFADVANCED_HPP