ManaPlus
normalopenglgraphics.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_NORMALOPENGLGRAPHICS_H
24 #define RENDER_NORMALOPENGLGRAPHICS_H
25 
26 #if defined USE_OPENGL && !defined ANDROID && !defined(__native_client__)
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  ~NormalOpenGLGraphics() override final;
63 
64  inline void drawQuadArrayfi(const int size) restrict2 A_INLINE;
65 
66  inline void drawQuadArrayfiCached(const int size) restrict2 A_INLINE;
67 
68  inline void drawQuadArrayfi(const GLint *restrict const intVertArray,
69  const GLfloat *restrict const
70  floatTexArray,
71  const int size) restrict2 A_INLINE;
72 
73  inline void drawQuadArrayii(const int size) restrict2 A_INLINE;
74 
75  inline void drawQuadArrayiiCached(const int size) restrict2 A_INLINE;
76 
77  inline void drawQuadArrayii(const GLint *restrict const intVertArray,
78  const GLint *restrict const intTexArray,
79  const int size) restrict2 A_INLINE;
80 
81  inline void drawLineArrayi(const int size) restrict2 A_INLINE;
82 
83  inline void drawLineArrayf(const int size) restrict2 A_INLINE;
84 
85  void testDraw() restrict2 override final;
86 
87  #include "render/graphicsdef.hpp"
89 
92 
95 
98 
99 #ifdef DEBUG_BIND_TEXTURE
100  unsigned int getBinds() const restrict2 noexcept2
101  { return mLastBinds; }
102 #endif // DEBUG_BIND_TEXTURE
103 
104  private:
113  bool mTexture;
114 
117  GLuint mImageCached;
118  float mFloatColor;
121 #ifdef DEBUG_BIND_TEXTURE
122  std::string mOldTexture;
123  unsigned int mOldTextureId;
124  static unsigned int mBinds;
125  static unsigned int mLastBinds;
126 #endif // DEBUG_BIND_TEXTURE
127 
129 };
130 #endif // defined USE_OPENGL && !defined ANDROID &&
131  // !defined(__native_client__)
132 
133 #endif // RENDER_NORMALOPENGLGRAPHICS_H
#define A_DELETE_COPY(func)
Definition: localconsts.h:52
void drawQuadArrayii(const int size) A_INLINE
#define A_NONNULLPOINTER
Definition: localconsts.h:257
void drawQuadArrayiiCached(const int size) A_INLINE
#define final
Definition: localconsts.h:45
void drawQuadArrayfiCached(const int size) A_INLINE
#define RENDER_OPENGLGRAPHICSDEF1_HPP
void drawQuadArrayfi(const int size) A_INLINE
#define RENDER_OPENGLGRAPHICSDEFADVANCED_HPP
void drawLineArrayf(const int size) A_INLINE
#define RENDER_OPENGLGRAPHICSDEF_HPP
#define PRAGMA48(str)
Definition: localconsts.h:190
void drawLineArrayi(const int size) A_INLINE
Definition: color.h:74
#define restrict
Definition: localconsts.h:156
#define noexcept2
Definition: localconsts.h:49
#define restrict2
Definition: localconsts.h:157
#define RENDER_GRAPHICSDEF_HPP