ManaPlus
Public Member Functions | Private Attributes
MobileOpenGLGraphics Class Reference

#include <mobileopenglgraphics.h>

Inheritance diagram for MobileOpenGLGraphics:
Graphics

Public Member Functions

 MobileOpenGLGraphics ()
 
 ~MobileOpenGLGraphics ()
 
void postInit ()
 
void drawTriangleArrayfs (const GLshort *const shortVertArray, const GLfloat *const floatTexArray, const int size) A_INLINE
 
void drawTriangleArrayfs (const int size) A_INLINE
 
void drawTriangleArrayfsCached (const int size) A_INLINE
 
void drawLineArrays (const int size) A_INLINE
 
- Public Member Functions inherited from Graphics
virtual ~Graphics ()
 
void setWindow (SDL_Surface *const window, const int width, const int height)
 
SDL_Surface * getWindow () const
 
void setSync (const bool sync)
 
bool getSync () const
 
virtual bool setVideoMode (const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)=0
 
bool setFullscreen (const bool fs)
 
virtual bool resizeScreen (const int width, const int height)
 
virtual void restoreContext ()
 
virtual void drawRescaledImage (const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight)=0
 
virtual void drawPattern (const Image *const image, const int x, const int y, const int w, const int h)=0
 
virtual void drawRescaledPattern (const Image *const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight)=0
 
virtual void drawImageRect (const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
 
virtual void calcPattern (ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const =0
 
virtual void calcPattern (ImageCollection *const vert, const Image *const image, const int x, const int y, const int w, const int h) const =0
 
virtual void calcTileVertexes (ImageVertexes *const vert, const Image *const image, int x, int y) const =0
 
virtual void calcTileSDL (ImageVertexes *const vert, int x, int y) const
 
virtual void drawTileVertexes (const ImageVertexes *const vert)=0
 
virtual void drawTileCollection (const ImageCollection *const vertCol)=0
 
virtual void calcTileCollection (ImageCollection *const vertCol, const Image *const image, int x, int y)=0
 
virtual void calcWindow (ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
 
virtual void fillRectangle (const Rect &rectangle)=0
 
virtual void updateScreen ()=0
 
void setWindowSize (const int width, const int height)
 
int getWidth () const
 
int getHeight () const
 
int getMemoryUsage () const
 
virtual void drawNet (const int x1, const int y1, const int x2, const int y2, const int width, const int height)
 
ClipRectgetTopClip () const
 
void setRedraw (const bool n)
 
bool getRedraw () const
 
void setSecure (const bool n)
 
bool getSecure () const
 
int getBpp () const
 
bool getFullScreen () const
 
bool getHWAccel () const
 
bool getDoubleBuffer () const
 
RenderType getOpenGL () const
 
void setNoFrame (const bool n)
 
const std::string & getName () const
 
virtual void initArrays (const int vertCount)
 
virtual void setColor (const Color &color)
 
const ColorgetColor () const
 
virtual void drawImage (const Image *const image, int dstX, int dstY)=0
 
virtual void copyImage (const Image *const image, int dstX, int dstY)=0
 
virtual void drawImageCached (const Image *const image, int srcX, int srcY)=0
 
virtual void drawPatternCached (const Image *const image, const int x, const int y, const int w, const int h)=0
 
virtual void completeCache ()=0
 
int getScale () const
 
virtual bool isAllowScale () const
 
void setScale (int scale)
 
virtual void pushClipArea (const Rect &area)
 
virtual void popClipArea ()
 
virtual void drawLine (int x1, int y1, int x2, int y2)=0
 
virtual void drawRectangle (const Rect &rectangle)=0
 
virtual void createGLContext (const bool custom)
 
virtual void drawPoint (int x, int y)=0
 
virtual void beginDraw ()
 
virtual void endDraw ()
 
virtual void clearScreen () const
 
virtual void deleteArrays ()
 
virtual void finalize (ImageCollection *const col)
 
virtual void finalize (ImageVertexes *const vert)
 
virtual void testDraw ()
 
virtual void removeArray (const uint32_t sz, uint32_t *const arr)
 
virtual void screenResized ()
 

Private Attributes

GLfloat * mFloatTexArray
 
GLshort * mShortVertArray
 
GLfloat * mFloatTexArrayCached
 
GLshort * mShortVertArrayCached
 
float mAlphaCached
 
int mVpCached
 
bool mTexture
 
bool mIsByteColor
 
Color mByteColor
 
GLuint mImageCached
 
float mFloatColor
 
int mMaxVertices
 
bool mColorAlpha
 
FBOInfo mFbo
 

Additional Inherited Members

- Public Types inherited from Graphics
enum  Alignment { LEFT = 0 , CENTER , RIGHT }
 
- Static Public Member Functions inherited from Graphics
static void cleanUp ()
 
- Data Fields inherited from Graphics
int mWidth
 
int mHeight
 
int mActualWidth
 
int mActualHeight
 
- Protected Member Functions inherited from Graphics
 Graphics ()
 
void setMainFlags (const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)
 
int getOpenGLFlags () const
 
int getSoftwareFlags () const
 
bool setOpenGLMode ()
 
void updateMemoryInfo ()
 
bool videoInfo ()
 
void setOpenGLFlags ()
 
- Protected Attributes inherited from Graphics
MStack< ClipRectmClipStack
 
SDL_Surface * mWindow
 
int mBpp
 
bool mAlpha
 
bool mFullscreen
 
bool mHWAccel
 
bool mRedraw
 
bool mDoubleBuffer
 
SDL_Rect mRect
 
bool mSecure
 
RenderType mOpenGL
 
bool mEnableResize
 
bool mNoFrame
 
bool mAllowHighDPI
 
std::string mName
 
int mStartFreeMem
 
bool mSync
 
int mScale
 
Color mColor
 
- Static Protected Attributes inherited from Graphics
static void * mGLContext = 0
 

Detailed Description

Definition at line 63 of file mobileopenglgraphics.h.

Constructor & Destructor Documentation

◆ MobileOpenGLGraphics()

MobileOpenGLGraphics::MobileOpenGLGraphics ( )

Definition at line 80 of file mobileopenglgraphics.cpp.

80  :
81  mFloatTexArray(nullptr),
82  mShortVertArray(nullptr),
83  mFloatTexArrayCached(nullptr),
84  mShortVertArrayCached(nullptr),
85  mAlphaCached(1.0F),
86  mVpCached(0),
87  mTexture(false),
88  mIsByteColor(false),
89  mByteColor(),
90  mImageCached(0),
91  mFloatColor(1.0F),
92  mMaxVertices(500),
93  mColorAlpha(false),
94 #ifdef DEBUG_BIND_TEXTURE
95  mOldTexture(),
96  mOldTextureId(0),
97 #endif // DEBUG_BIND_TEXTURE
98  mFbo()
99 {
101  mName = "mobile OpenGL ES";
102 }
RenderType mOpenGL
Definition: graphics.h:545
std::string mName
Definition: graphics.h:549
@ RENDER_GLES_OPENGL
Definition: rendertype.h:30

References Graphics::mName, Graphics::mOpenGL, and RENDER_GLES_OPENGL.

◆ ~MobileOpenGLGraphics()

MobileOpenGLGraphics::~MobileOpenGLGraphics ( )

Definition at line 104 of file mobileopenglgraphics.cpp.

105 {
107 }
void deleteArraysInternal() restrict2

References deleteArraysInternal().

Member Function Documentation

◆ drawLineArrays()

void MobileOpenGLGraphics::drawLineArrays ( const int  size)
inline

Definition at line 1280 of file mobileopenglgraphics.cpp.

1281 {
1282  glVertexPointer(2, GL_SHORT, 0, mShortVertArray);
1283 
1284 #ifdef DEBUG_DRAW_CALLS
1285  mDrawCalls ++;
1286 #endif // DEBUG_DRAW_CALLS
1287 
1288  mglDrawArrays(GL_LINES, 0, size / 2);
1289 #ifdef OPENGLERRORS
1291 #endif // OPENGLERRORS
1292 }
static void logError()
GraphicsManager graphicsManager
#define mglDrawArrays(...)
Definition: mgl.hpp:83
int size()
Definition: emotedb.cpp:306

References graphicsManager, GraphicsManager::logError(), mglDrawArrays, and EmoteDB::size().

◆ drawTriangleArrayfs() [1/2]

void MobileOpenGLGraphics::drawTriangleArrayfs ( const GLshort *const  shortVertArray,
const GLfloat *const  floatTexArray,
const int  size 
)
inline

Definition at line 1261 of file mobileopenglgraphics.cpp.

1266 {
1267  glVertexPointer(2, GL_SHORT, 0, shortVertArray);
1268  glTexCoordPointer(2, GL_FLOAT, 0, floatTexArray);
1269 
1270 #ifdef DEBUG_DRAW_CALLS
1271  mDrawCalls ++;
1272 #endif // DEBUG_DRAW_CALLS
1273 
1274  mglDrawArrays(GL_TRIANGLES, 0, size / 2);
1275 #ifdef OPENGLERRORS
1277 #endif // OPENGLERRORS
1278 }

References graphicsManager, GraphicsManager::logError(), mglDrawArrays, and EmoteDB::size().

◆ drawTriangleArrayfs() [2/2]

void MobileOpenGLGraphics::drawTriangleArrayfs ( const int  size)
inline

Definition at line 1230 of file mobileopenglgraphics.cpp.

1231 {
1232  glVertexPointer(2, GL_SHORT, 0, mShortVertArray);
1233  glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArray);
1234 
1235 #ifdef DEBUG_DRAW_CALLS
1236  mDrawCalls ++;
1237 #endif // DEBUG_DRAW_CALLS
1238 
1239  mglDrawArrays(GL_TRIANGLES, 0, size / 2);
1240 #ifdef OPENGLERRORS
1242 #endif // OPENGLERRORS
1243 }

References graphicsManager, GraphicsManager::logError(), mglDrawArrays, and EmoteDB::size().

◆ drawTriangleArrayfsCached()

void MobileOpenGLGraphics::drawTriangleArrayfsCached ( const int  size)
inline

Definition at line 1245 of file mobileopenglgraphics.cpp.

1247 {
1248  glVertexPointer(2, GL_SHORT, 0, mShortVertArrayCached);
1249  glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArrayCached);
1250 
1251 #ifdef DEBUG_DRAW_CALLS
1252  mDrawCalls ++;
1253 #endif // DEBUG_DRAW_CALLS
1254 
1255  mglDrawArrays(GL_TRIANGLES, 0, size / 2);
1256 #ifdef OPENGLERRORS
1258 #endif // OPENGLERRORS
1259 }

References graphicsManager, GraphicsManager::logError(), mglDrawArrays, and EmoteDB::size().

◆ postInit()

void MobileOpenGLGraphics::postInit ( )
virtual

Reimplemented from Graphics.

Definition at line 109 of file mobileopenglgraphics.cpp.

110 {
111 // glesTest();
112 }

Field Documentation

◆ mAlphaCached

float MobileOpenGLGraphics::mAlphaCached
private

Definition at line 104 of file mobileopenglgraphics.h.

◆ mByteColor

Color MobileOpenGLGraphics::mByteColor
private

Definition at line 109 of file mobileopenglgraphics.h.

Referenced by restoreColor().

◆ mColorAlpha

bool MobileOpenGLGraphics::mColorAlpha
private

Definition at line 113 of file mobileopenglgraphics.h.

◆ mFbo

FBOInfo MobileOpenGLGraphics::mFbo
private

Definition at line 119 of file mobileopenglgraphics.h.

◆ mFloatColor

float MobileOpenGLGraphics::mFloatColor
private

Definition at line 111 of file mobileopenglgraphics.h.

◆ mFloatTexArray

GLfloat* MobileOpenGLGraphics::mFloatTexArray
private

Definition at line 100 of file mobileopenglgraphics.h.

◆ mFloatTexArrayCached

GLfloat* MobileOpenGLGraphics::mFloatTexArrayCached
private

Definition at line 102 of file mobileopenglgraphics.h.

◆ mImageCached

GLuint MobileOpenGLGraphics::mImageCached
private

Definition at line 110 of file mobileopenglgraphics.h.

◆ mIsByteColor

bool MobileOpenGLGraphics::mIsByteColor
private

Definition at line 108 of file mobileopenglgraphics.h.

Referenced by restoreColor().

◆ mMaxVertices

int MobileOpenGLGraphics::mMaxVertices
private

Definition at line 112 of file mobileopenglgraphics.h.

◆ mShortVertArray

GLshort* MobileOpenGLGraphics::mShortVertArray
private

Definition at line 101 of file mobileopenglgraphics.h.

◆ mShortVertArrayCached

GLshort* MobileOpenGLGraphics::mShortVertArrayCached
private

Definition at line 103 of file mobileopenglgraphics.h.

◆ mTexture

bool MobileOpenGLGraphics::mTexture
private

Definition at line 106 of file mobileopenglgraphics.h.

◆ mVpCached

int MobileOpenGLGraphics::mVpCached
private

Definition at line 105 of file mobileopenglgraphics.h.


The documentation for this class was generated from the following files: