Otclient  14/8/2020
PainterShaderProgram Class Reference

#include <paintershaderprogram.h>

Inheritance diagram for PainterShaderProgram:
Collaboration diagram for PainterShaderProgram:

Public Member Functions

 PainterShaderProgram ()
 
bool link ()
 
void setTransformMatrix (const Matrix3 &transformMatrix)
 
void setProjectionMatrix (const Matrix3 &projectionMatrix)
 
void setTextureMatrix (const Matrix3 &textureMatrix)
 
void setColor (const Color &color)
 
void setOpacity (float opacity)
 
void setResolution (const Size &resolution)
 
void updateTime ()
 
void addMultiTexture (const std::string &file)
 
void bindMultiTextures ()
 
- Public Member Functions inherited from ShaderProgram
 ShaderProgram ()
 
 ~ShaderProgram ()
 
bool addShader (const ShaderPtr &shader)
 
bool addShaderFromSourceCode (Shader::ShaderType shaderType, const std::string &sourceCode)
 
bool addShaderFromSourceFile (Shader::ShaderType shaderType, const std::string &sourceFile)
 
void removeShader (const ShaderPtr &shader)
 
void removeAllShaders ()
 
bool bind ()
 
std::string log ()
 
void disableAttributeArray (const char *name)
 
void enableAttributeArray (const char *name)
 
int getAttributeLocation (const char *name)
 
void bindAttributeLocation (int location, const char *name)
 
void bindUniformLocation (int location, const char *name)
 
void setAttributeArray (int location, const float *values, int size, int stride=0)
 
void setAttributeValue (int location, float value)
 
void setAttributeValue (int location, float x, float y)
 
void setAttributeValue (int location, float x, float y, float z)
 
void setAttributeArray (const char *name, const float *values, int size, int stride=0)
 
void setAttributeValue (const char *name, float value)
 
void setAttributeValue (const char *name, float x, float y)
 
void setAttributeValue (const char *name, float x, float y, float z)
 
void setUniformValue (int location, const Color &color)
 
void setUniformValue (int location, int value)
 
void setUniformValue (int location, float value)
 
void setUniformValue (int location, float x, float y)
 
void setUniformValue (int location, float x, float y, float z)
 
void setUniformValue (int location, float x, float y, float z, float w)
 
void setUniformValue (int location, const Matrix2 &mat)
 
void setUniformValue (int location, const Matrix3 &mat)
 
void setUniformValue (const char *name, const Color &color)
 
void setUniformValue (const char *name, int value)
 
void setUniformValue (const char *name, float value)
 
void setUniformValue (const char *name, float x, float y)
 
void setUniformValue (const char *name, float x, float y, float z)
 
void setUniformValue (const char *name, float x, float y, float z, float w)
 
void setUniformValue (const char *name, const Matrix2 &mat)
 
void setUniformValue (const char *name, const Matrix3 &mat)
 
bool isLinked ()
 
uint getProgramId ()
 
ShaderList getShaders ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Types

enum  {
  VERTEX_ATTR = 0, TEXCOORD_ATTR = 1, PROJECTION_MATRIX_UNIFORM = 0, TEXTURE_MATRIX_UNIFORM = 1,
  COLOR_UNIFORM = 2, OPACITY_UNIFORM = 3, TIME_UNIFORM = 4, TEX0_UNIFORM = 5,
  TEX1_UNIFORM = 6, TEX2_UNIFORM = 7, TEX3_UNIFORM = 8, RESOLUTION_UNIFORM = 9,
  TRANSFORM_MATRIX_UNIFORM = 10
}
 

Protected Member Functions

virtual void setupUniforms ()
 

Friends

class PainterOGL2
 

Additional Inherited Members

- Static Public Member Functions inherited from ShaderProgram
static void release ()
 
static void disableAttributeArray (int location)
 
static void enableAttributeArray (int location)
 

Detailed Description

Definition at line 30 of file paintershaderprogram.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
VERTEX_ATTR 
TEXCOORD_ATTR 
PROJECTION_MATRIX_UNIFORM 
TEXTURE_MATRIX_UNIFORM 
COLOR_UNIFORM 
OPACITY_UNIFORM 
TIME_UNIFORM 
TEX0_UNIFORM 
TEX1_UNIFORM 
TEX2_UNIFORM 
TEX3_UNIFORM 
RESOLUTION_UNIFORM 
TRANSFORM_MATRIX_UNIFORM 

Definition at line 33 of file paintershaderprogram.h.

Constructor & Destructor Documentation

◆ PainterShaderProgram()

PainterShaderProgram::PainterShaderProgram ( )

Definition at line 31 of file paintershaderprogram.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addMultiTexture()

void PainterShaderProgram::addMultiTexture ( const std::string &  file)

Definition at line 151 of file paintershaderprogram.cpp.

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

◆ bindMultiTextures()

void PainterShaderProgram::bindMultiTextures ( )

Definition at line 166 of file paintershaderprogram.cpp.

Here is the caller graph for this function:

◆ link()

bool PainterShaderProgram::link ( )
virtual

Reimplemented from ShaderProgram.

Definition at line 66 of file paintershaderprogram.cpp.

Here is the call graph for this function:

◆ setColor()

void PainterShaderProgram::setColor ( const Color color)

Definition at line 110 of file paintershaderprogram.cpp.

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

◆ setOpacity()

void PainterShaderProgram::setOpacity ( float  opacity)

Definition at line 120 of file paintershaderprogram.cpp.

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

◆ setProjectionMatrix()

void PainterShaderProgram::setProjectionMatrix ( const Matrix3 projectionMatrix)

Definition at line 90 of file paintershaderprogram.cpp.

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

◆ setResolution()

void PainterShaderProgram::setResolution ( const Size resolution)

Definition at line 130 of file paintershaderprogram.cpp.

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

◆ setTextureMatrix()

void PainterShaderProgram::setTextureMatrix ( const Matrix3 textureMatrix)

Definition at line 100 of file paintershaderprogram.cpp.

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

◆ setTransformMatrix()

void PainterShaderProgram::setTransformMatrix ( const Matrix3 transformMatrix)

Definition at line 80 of file paintershaderprogram.cpp.

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

◆ setupUniforms()

void PainterShaderProgram::setupUniforms ( )
protectedvirtual

Definition at line 39 of file paintershaderprogram.cpp.

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

◆ updateTime()

void PainterShaderProgram::updateTime ( )

Definition at line 140 of file paintershaderprogram.cpp.

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

Friends And Related Function Documentation

◆ PainterOGL2

friend class PainterOGL2
friend

Definition at line 49 of file paintershaderprogram.h.


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