Otclient  14/8/2020
PainterOGL1 Class Reference

#include <painterogl1.h>

Inheritance diagram for PainterOGL1:
Collaboration diagram for PainterOGL1:

Public Types

enum  MatrixMode { MatrixProjection = 0x1701, MatrixTexture = 0x1702, MatrixTransform = 0x1700 }
 
- 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 }
 

Public Member Functions

 PainterOGL1 ()
 
void bind ()
 
void unbind ()
 
void refreshState ()
 
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)
 
void setMatrixMode (MatrixMode matrixMode)
 
void setTransformMatrix (const Matrix3 &transformMatrix)
 
void setProjectionMatrix (const Matrix3 &projectionMatrix)
 
void setTextureMatrix (const Matrix3 &textureMatrix)
 
void setColor (const Color &color)
 
void setOpacity (float opacity)
 
bool hasShaders ()
 
- Public Member Functions inherited from PainterOGL
 PainterOGL ()
 
virtual ~PainterOGL ()
 
void resetState ()
 
void saveState ()
 
void saveAndResetState ()
 
void restoreSavedState ()
 
void clear (const Color &color)
 
void clearRect (const Color &color, const Rect &rect)
 
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)
 
void setShaderProgram (const PainterShaderProgramPtr &shaderProgram)
 
void scale (float factor)
 
void translate (const Point &p)
 
void rotate (const Point &p, float angle)
 
Size getResolution ()
 
Color getColor ()
 
float getOpacity ()
 
Rect getClipRect ()
 
CompositionMode getCompositionMode ()
 
void resetClipRect ()
 
void resetOpacity ()
 
void resetCompositionMode ()
 
void resetColor ()
 
void resetShaderProgram ()
 

Additional Inherited Members

- 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 1.1 fixed-function rendering pipeline, compatible with OpenGL ES 1.0 and intended to be used on older graphics cards. Shaders are not available for this painter engine.

Definition at line 36 of file painterogl1.h.

Member Enumeration Documentation

◆ MatrixMode

Enumerator
MatrixProjection 
MatrixTexture 
MatrixTransform 

Definition at line 39 of file painterogl1.h.

Constructor & Destructor Documentation

◆ PainterOGL1()

PainterOGL1::PainterOGL1 ( )

Definition at line 30 of file painterogl1.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ bind()

void PainterOGL1::bind ( )
virtual

Reimplemented from PainterOGL.

Definition at line 47 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawBoundingRect()

void PainterOGL1::drawBoundingRect ( const Rect dest,
int  innerLineWidth 
)
virtual

Implements Painter.

Definition at line 213 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawCoords()

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

Implements Painter.

Definition at line 63 of file painterogl1.cpp.

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

◆ drawFillCoords()

void PainterOGL1::drawFillCoords ( CoordsBuffer coordsBuffer)
virtual

Implements Painter.

Definition at line 138 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawFilledRect()

void PainterOGL1::drawFilledRect ( const Rect dest)
virtual

Implements Painter.

Definition at line 189 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawFilledTriangle()

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

Implements Painter.

Definition at line 201 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawRepeatedTexturedRect()

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

Implements Painter.

Definition at line 177 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawTextureCoords()

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

Implements Painter.

Definition at line 144 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawTexturedRect()

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

Implements Painter.

Definition at line 153 of file painterogl1.cpp.

Here is the call graph for this function:

◆ drawUpsideDownTexturedRect()

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

Implements Painter.

Definition at line 165 of file painterogl1.cpp.

Here is the call graph for this function:

◆ hasShaders()

bool PainterOGL1::hasShaders ( )
inlinevirtual

Implements Painter.

Definition at line 69 of file painterogl1.h.

◆ refreshState()

void PainterOGL1::refreshState ( )
virtual

Reimplemented from PainterOGL.

Definition at line 36 of file painterogl1.cpp.

Here is the call graph for this function:

◆ setColor()

void PainterOGL1::setColor ( const Color color)
virtual

Reimplemented from Painter.

Definition at line 256 of file painterogl1.cpp.

◆ setMatrixMode()

void PainterOGL1::setMatrixMode ( PainterOGL1::MatrixMode  matrixMode)

Definition at line 225 of file painterogl1.cpp.

◆ setOpacity()

void PainterOGL1::setOpacity ( float  opacity)
virtual

Reimplemented from Painter.

Definition at line 264 of file painterogl1.cpp.

◆ setProjectionMatrix()

void PainterOGL1::setProjectionMatrix ( const Matrix3 projectionMatrix)
virtual

Reimplemented from PainterOGL.

Definition at line 240 of file painterogl1.cpp.

◆ setTextureMatrix()

void PainterOGL1::setTextureMatrix ( const Matrix3 textureMatrix)
virtual

Reimplemented from PainterOGL.

Definition at line 247 of file painterogl1.cpp.

◆ setTransformMatrix()

void PainterOGL1::setTransformMatrix ( const Matrix3 transformMatrix)
virtual

Reimplemented from PainterOGL.

Definition at line 233 of file painterogl1.cpp.

◆ unbind()

void PainterOGL1::unbind ( )
virtual

Reimplemented from PainterOGL.

Definition at line 57 of file painterogl1.cpp.

Here is the call graph for this function:

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