Otclient  14/8/2020
PainterOGL2 Class Reference

#include <painterogl2.h>

Inheritance diagram for PainterOGL2:
Collaboration diagram for PainterOGL2:

Public Member Functions

 PainterOGL2 ()
 
void bind ()
 
void unbind ()
 
void drawCoords (CoordsBuffer &coordsBuffer, DrawMode drawMode=Triangles)
 
void drawFillCoords (CoordsBuffer &coordsBuffer)
 
void drawTextureCoords (CoordsBuffer &coordsBuffer, const TexturePtr &texture)
 
void drawTexturedRect (const Rect &dest, const TexturePtr &texture, const Rect &src)
 
void drawUpsideDownTexturedRect (const Rect &dest, const TexturePtr &texture, const Rect &src)
 
void drawRepeatedTexturedRect (const Rect &dest, const TexturePtr &texture, const Rect &src)
 
void drawFilledRect (const Rect &dest)
 
void drawFilledTriangle (const Point &a, const Point &b, const Point &c)
 
void drawBoundingRect (const Rect &dest, int innerLineWidth=1)
 
void setDrawProgram (PainterShaderProgram *drawProgram)
 
bool hasShaders ()
 
- Public Member Functions inherited from PainterOGL
 PainterOGL ()
 
virtual ~PainterOGL ()
 
void resetState ()
 
virtual void refreshState ()
 
void saveState ()
 
void saveAndResetState ()
 
void restoreSavedState ()
 
void clear (const Color &color)
 
void clearRect (const Color &color, const Rect &rect)
 
virtual void setTransformMatrix (const Matrix3 &transformMatrix)
 
virtual void setProjectionMatrix (const Matrix3 &projectionMatrix)
 
virtual void setTextureMatrix (const Matrix3 &textureMatrix)
 
virtual void setCompositionMode (CompositionMode compositionMode)
 
virtual void setBlendEquation (BlendEquation blendEquation)
 
virtual void setClipRect (const Rect &clipRect)
 
virtual void setShaderProgram (PainterShaderProgram *shaderProgram)
 
virtual void setTexture (Texture *texture)
 
virtual void setAlphaWriting (bool enable)
 
void setTexture (const TexturePtr &texture)
 
void setResolution (const Size &resolution)
 
void scale (float x, float y)
 
void translate (float x, float y)
 
void rotate (float angle)
 
void rotate (float x, float y, float angle)
 
void pushTransformMatrix ()
 
void popTransformMatrix ()
 
Matrix3 getTransformMatrix ()
 
Matrix3 getProjectionMatrix ()
 
Matrix3 getTextureMatrix ()
 
BlendEquation getBlendEquation ()
 
PainterShaderProgramgetShaderProgram ()
 
bool getAlphaWriting ()
 
void resetBlendEquation ()
 
void resetTexture ()
 
void resetAlphaWriting ()
 
void resetTransformMatrix ()
 
- Public Member Functions inherited from Painter
 Painter ()
 
virtual ~Painter ()
 
void drawTexturedRect (const Rect &dest, const TexturePtr &texture)
 
virtual void setColor (const Color &color)
 
void setShaderProgram (const PainterShaderProgramPtr &shaderProgram)
 
void scale (float factor)
 
void translate (const Point &p)
 
void rotate (const Point &p, float angle)
 
virtual void setOpacity (float opacity)
 
Size getResolution ()
 
Color getColor ()
 
float getOpacity ()
 
Rect getClipRect ()
 
CompositionMode getCompositionMode ()
 
void resetClipRect ()
 
void resetOpacity ()
 
void resetCompositionMode ()
 
void resetColor ()
 
void resetShaderProgram ()
 

Additional Inherited Members

- Public Types inherited from Painter
enum  BlendEquation { BlendEquation_Add, BlendEquation_Max }
 
enum  CompositionMode {
  CompositionMode_Normal, CompositionMode_Multiply, CompositionMode_Add, CompositionMode_Replace,
  CompositionMode_DestBlending, CompositionMode_Light
}
 
enum  DrawMode { Triangles = GL_TRIANGLES, TriangleStrip = GL_TRIANGLE_STRIP }
 
- Protected Member Functions inherited from PainterOGL
void updateGlTexture ()
 
void updateGlCompositionMode ()
 
void updateGlBlendEquation ()
 
void updateGlClipRect ()
 
void updateGlAlphaWriting ()
 
void updateGlViewport ()
 
- Protected Attributes inherited from PainterOGL
CoordsBuffer m_coordsBuffer
 
std::vector< Matrix3m_transformMatrixStack
 
Matrix3 m_transformMatrix
 
Matrix3 m_projectionMatrix
 
Matrix3 m_textureMatrix
 
BlendEquation m_blendEquation
 
Texturem_texture
 
bool m_alphaWriting
 
PainterState m_olderStates [10]
 
int m_oldStateIndex
 
uint m_glTextureId
 
- Protected Attributes inherited from Painter
PainterShaderProgramm_shaderProgram
 
CompositionMode m_compositionMode
 
Color m_color
 
Size m_resolution
 
float m_opacity
 
Rect m_clipRect
 

Detailed Description

Painter using OpenGL 2.0 programmable rendering pipeline, compatible with OpenGL ES 2.0. Only recent cards support this painter engine.

Definition at line 35 of file painterogl2.h.

Constructor & Destructor Documentation

◆ PainterOGL2()

PainterOGL2::PainterOGL2 ( )

Definition at line 29 of file painterogl2.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ bind()

void PainterOGL2::bind ( )
virtual

Reimplemented from PainterOGL.

Definition at line 49 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawBoundingRect()

void PainterOGL2::drawBoundingRect ( const Rect dest,
int  innerLineWidth = 1 
)
virtual

Implements Painter.

Definition at line 203 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawCoords()

void PainterOGL2::drawCoords ( CoordsBuffer coordsBuffer,
DrawMode  drawMode = Triangles 
)
virtual

Implements Painter.

Definition at line 66 of file painterogl2.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawFillCoords()

void PainterOGL2::drawFillCoords ( CoordsBuffer coordsBuffer)
virtual

Implements Painter.

Definition at line 123 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawFilledRect()

void PainterOGL2::drawFilledRect ( const Rect dest)
virtual

Implements Painter.

Definition at line 179 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawFilledTriangle()

void PainterOGL2::drawFilledTriangle ( const Point a,
const Point b,
const Point c 
)
virtual

Implements Painter.

Definition at line 191 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawRepeatedTexturedRect()

void PainterOGL2::drawRepeatedTexturedRect ( const Rect dest,
const TexturePtr texture,
const Rect src 
)
virtual

Implements Painter.

Definition at line 166 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawTextureCoords()

void PainterOGL2::drawTextureCoords ( CoordsBuffer coordsBuffer,
const TexturePtr texture 
)
virtual

Implements Painter.

Definition at line 130 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawTexturedRect()

void PainterOGL2::drawTexturedRect ( const Rect dest,
const TexturePtr texture,
const Rect src 
)
virtual

Implements Painter.

Definition at line 140 of file painterogl2.cpp.

Here is the call graph for this function:

◆ drawUpsideDownTexturedRect()

void PainterOGL2::drawUpsideDownTexturedRect ( const Rect dest,
const TexturePtr texture,
const Rect src 
)
virtual

Implements Painter.

Definition at line 153 of file painterogl2.cpp.

Here is the call graph for this function:

◆ hasShaders()

bool PainterOGL2::hasShaders ( )
inlinevirtual

Implements Painter.

Definition at line 55 of file painterogl2.h.

◆ setDrawProgram()

void PainterOGL2::setDrawProgram ( PainterShaderProgram drawProgram)
inline

Definition at line 53 of file painterogl2.h.

Here is the caller graph for this function:

◆ unbind()

void PainterOGL2::unbind ( )
virtual

Reimplemented from PainterOGL.

Definition at line 59 of file painterogl2.cpp.

Here is the call graph for this function:

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