Otclient  14/8/2020
PainterOGL Class Reference

#include <painterogl.h>

Inheritance diagram for PainterOGL:
Collaboration diagram for PainterOGL:

Classes

struct  PainterState
 

Public Member Functions

 PainterOGL ()
 
virtual ~PainterOGL ()
 
virtual void bind ()
 
virtual void unbind ()
 
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 ()
 
virtual void drawCoords (CoordsBuffer &coordsBuffer, DrawMode drawMode=Triangles)=0
 
virtual void drawFillCoords (CoordsBuffer &coordsBuffer)=0
 
virtual void drawTextureCoords (CoordsBuffer &coordsBuffer, const TexturePtr &texture)=0
 
virtual void drawTexturedRect (const Rect &dest, const TexturePtr &texture, const Rect &src)=0
 
void drawTexturedRect (const Rect &dest, const TexturePtr &texture)
 
virtual void drawUpsideDownTexturedRect (const Rect &dest, const TexturePtr &texture, const Rect &src)=0
 
virtual void drawRepeatedTexturedRect (const Rect &dest, const TexturePtr &texture, const Rect &src)=0
 
virtual void drawFilledRect (const Rect &dest)=0
 
virtual void drawFilledTriangle (const Point &a, const Point &b, const Point &c)=0
 
virtual void drawBoundingRect (const Rect &dest, int innerLineWidth=1)=0
 
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 ()
 
virtual bool hasShaders ()=0
 

Protected Member Functions

void updateGlTexture ()
 
void updateGlCompositionMode ()
 
void updateGlBlendEquation ()
 
void updateGlClipRect ()
 
void updateGlAlphaWriting ()
 
void updateGlViewport ()
 

Protected Attributes

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
 

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 }
 

Detailed Description

Definition at line 28 of file painterogl.h.

Constructor & Destructor Documentation

◆ PainterOGL()

PainterOGL::PainterOGL ( )

Definition at line 27 of file painterogl.cpp.

Here is the call graph for this function:

◆ ~PainterOGL()

virtual PainterOGL::~PainterOGL ( )
inlinevirtual

Definition at line 47 of file painterogl.h.

Member Function Documentation

◆ bind()

virtual void PainterOGL::bind ( )
inlinevirtual

Reimplemented from Painter.

Reimplemented in PainterOGL1, and PainterOGL2.

Definition at line 49 of file painterogl.h.

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

◆ clear()

void PainterOGL::clear ( const Color color)
virtual

Implements Painter.

Definition at line 105 of file painterogl.cpp.

Here is the call graph for this function:

◆ clearRect()

void PainterOGL::clearRect ( const Color color,
const Rect rect 
)

Definition at line 111 of file painterogl.cpp.

Here is the call graph for this function:

◆ getAlphaWriting()

bool PainterOGL::getAlphaWriting ( )
inline

Definition at line 87 of file painterogl.h.

◆ getBlendEquation()

BlendEquation PainterOGL::getBlendEquation ( )
inline

Definition at line 85 of file painterogl.h.

◆ getProjectionMatrix()

Matrix3 PainterOGL::getProjectionMatrix ( )
inline

Definition at line 83 of file painterogl.h.

◆ getShaderProgram()

PainterShaderProgram* PainterOGL::getShaderProgram ( )
inline

Definition at line 86 of file painterogl.h.

◆ getTextureMatrix()

Matrix3 PainterOGL::getTextureMatrix ( )
inline

Definition at line 84 of file painterogl.h.

◆ getTransformMatrix()

Matrix3 PainterOGL::getTransformMatrix ( )
inline

Definition at line 82 of file painterogl.h.

◆ popTransformMatrix()

void PainterOGL::popTransformMatrix ( )
virtual

Implements Painter.

Definition at line 245 of file painterogl.cpp.

Here is the call graph for this function:

◆ pushTransformMatrix()

void PainterOGL::pushTransformMatrix ( )
virtual

Implements Painter.

Definition at line 239 of file painterogl.cpp.

◆ refreshState()

void PainterOGL::refreshState ( )
virtual

Reimplemented in PainterOGL1.

Definition at line 54 of file painterogl.cpp.

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

◆ resetAlphaWriting()

void PainterOGL::resetAlphaWriting ( )
inline

Definition at line 91 of file painterogl.h.

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

◆ resetBlendEquation()

void PainterOGL::resetBlendEquation ( )
inline

Definition at line 89 of file painterogl.h.

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

◆ resetState()

void PainterOGL::resetState ( )

Definition at line 41 of file painterogl.cpp.

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

◆ resetTexture()

void PainterOGL::resetTexture ( )
inline

Definition at line 90 of file painterogl.h.

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

◆ resetTransformMatrix()

void PainterOGL::resetTransformMatrix ( )
inline

Definition at line 92 of file painterogl.h.

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

◆ restoreSavedState()

void PainterOGL::restoreSavedState ( )
virtual

Implements Painter.

Definition at line 88 of file painterogl.cpp.

Here is the call graph for this function:

◆ rotate() [1/2]

void PainterOGL::rotate ( float  angle)
virtual

Implements Painter.

Definition at line 221 of file painterogl.cpp.

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

◆ rotate() [2/2]

void PainterOGL::rotate ( float  x,
float  y,
float  angle 
)
virtual

Implements Painter.

Definition at line 232 of file painterogl.cpp.

Here is the call graph for this function:

◆ saveAndResetState()

void PainterOGL::saveAndResetState ( )
virtual

Implements Painter.

Definition at line 82 of file painterogl.cpp.

Here is the call graph for this function:

◆ saveState()

void PainterOGL::saveState ( )
virtual

Implements Painter.

Definition at line 64 of file painterogl.cpp.

Here is the caller graph for this function:

◆ scale()

void PainterOGL::scale ( float  x,
float  y 
)
virtual

Implements Painter.

Definition at line 199 of file painterogl.cpp.

Here is the call graph for this function:

◆ setAlphaWriting()

void PainterOGL::setAlphaWriting ( bool  enable)
virtual

Implements Painter.

Definition at line 164 of file painterogl.cpp.

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

◆ setBlendEquation()

void PainterOGL::setBlendEquation ( Painter::BlendEquation  blendEquation)
virtual

Implements Painter.

Definition at line 128 of file painterogl.cpp.

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

◆ setClipRect()

void PainterOGL::setClipRect ( const Rect clipRect)
virtual

Implements Painter.

Definition at line 136 of file painterogl.cpp.

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

◆ setCompositionMode()

void PainterOGL::setCompositionMode ( Painter::CompositionMode  compositionMode)
virtual

Implements Painter.

Definition at line 120 of file painterogl.cpp.

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

◆ setProjectionMatrix()

virtual void PainterOGL::setProjectionMatrix ( const Matrix3 projectionMatrix)
inlinevirtual

Reimplemented in PainterOGL1.

Definition at line 62 of file painterogl.h.

Here is the caller graph for this function:

◆ setResolution()

void PainterOGL::setResolution ( const Size resolution)
virtual

Reimplemented from Painter.

Definition at line 173 of file painterogl.cpp.

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

◆ setShaderProgram()

virtual void PainterOGL::setShaderProgram ( PainterShaderProgram shaderProgram)
inlinevirtual

Reimplemented from Painter.

Definition at line 67 of file painterogl.h.

Here is the caller graph for this function:

◆ setTexture() [1/2]

void PainterOGL::setTexture ( const TexturePtr texture)
inline

Definition at line 71 of file painterogl.h.

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

◆ setTexture() [2/2]

void PainterOGL::setTexture ( Texture texture)
virtual

Implements Painter.

Definition at line 144 of file painterogl.cpp.

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

◆ setTextureMatrix()

virtual void PainterOGL::setTextureMatrix ( const Matrix3 textureMatrix)
inlinevirtual

Reimplemented in PainterOGL1.

Definition at line 63 of file painterogl.h.

Here is the caller graph for this function:

◆ setTransformMatrix()

virtual void PainterOGL::setTransformMatrix ( const Matrix3 transformMatrix)
inlinevirtual

Reimplemented in PainterOGL1.

Definition at line 61 of file painterogl.h.

Here is the caller graph for this function:

◆ translate()

void PainterOGL::translate ( float  x,
float  y 
)
virtual

Implements Painter.

Definition at line 210 of file painterogl.cpp.

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

◆ unbind()

virtual void PainterOGL::unbind ( )
inlinevirtual

Reimplemented from Painter.

Reimplemented in PainterOGL1, and PainterOGL2.

Definition at line 50 of file painterogl.h.

◆ updateGlAlphaWriting()

void PainterOGL::updateGlAlphaWriting ( )
protected

Definition at line 306 of file painterogl.cpp.

Here is the caller graph for this function:

◆ updateGlBlendEquation()

void PainterOGL::updateGlBlendEquation ( )
protected

Definition at line 285 of file painterogl.cpp.

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

◆ updateGlClipRect()

void PainterOGL::updateGlClipRect ( )
protected

Definition at line 295 of file painterogl.cpp.

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

◆ updateGlCompositionMode()

void PainterOGL::updateGlCompositionMode ( )
protected

Definition at line 258 of file painterogl.cpp.

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

◆ updateGlTexture()

void PainterOGL::updateGlTexture ( )
protected

Definition at line 252 of file painterogl.cpp.

Here is the caller graph for this function:

◆ updateGlViewport()

void PainterOGL::updateGlViewport ( )
protected

Definition at line 314 of file painterogl.cpp.

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

Member Data Documentation

◆ m_alphaWriting

bool PainterOGL::m_alphaWriting
protected

Definition at line 111 of file painterogl.h.

◆ m_blendEquation

BlendEquation PainterOGL::m_blendEquation
protected

Definition at line 109 of file painterogl.h.

◆ m_coordsBuffer

CoordsBuffer PainterOGL::m_coordsBuffer
protected

Definition at line 102 of file painterogl.h.

◆ m_glTextureId

uint PainterOGL::m_glTextureId
protected

Definition at line 116 of file painterogl.h.

◆ m_olderStates

PainterState PainterOGL::m_olderStates[10]
protected

Definition at line 113 of file painterogl.h.

◆ m_oldStateIndex

int PainterOGL::m_oldStateIndex
protected

Definition at line 114 of file painterogl.h.

◆ m_projectionMatrix

Matrix3 PainterOGL::m_projectionMatrix
protected

Definition at line 106 of file painterogl.h.

◆ m_texture

Texture* PainterOGL::m_texture
protected

Definition at line 110 of file painterogl.h.

◆ m_textureMatrix

Matrix3 PainterOGL::m_textureMatrix
protected

Definition at line 107 of file painterogl.h.

◆ m_transformMatrix

Matrix3 PainterOGL::m_transformMatrix
protected

Definition at line 105 of file painterogl.h.

◆ m_transformMatrixStack

std::vector<Matrix3> PainterOGL::m_transformMatrixStack
protected

Definition at line 104 of file painterogl.h.


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