Otclient  14/8/2020
ShaderProgram Class Reference

#include <shaderprogram.h>

Inheritance diagram for ShaderProgram:
Collaboration diagram for ShaderProgram:

Public Member Functions

 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 ()
 
virtual bool link ()
 
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 ()
 

Static Public Member Functions

static void release ()
 
static void disableAttributeArray (int location)
 
static void enableAttributeArray (int location)
 

Detailed Description

Definition at line 30 of file shaderprogram.h.

Constructor & Destructor Documentation

◆ ShaderProgram()

ShaderProgram::ShaderProgram ( )

Definition at line 30 of file shaderprogram.cpp.

Here is the call graph for this function:

◆ ~ShaderProgram()

ShaderProgram::~ShaderProgram ( )

Definition at line 39 of file shaderprogram.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addShader()

bool ShaderProgram::addShader ( const ShaderPtr shader)

Definition at line 48 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ addShaderFromSourceCode()

bool ShaderProgram::addShaderFromSourceCode ( Shader::ShaderType  shaderType,
const std::string &  sourceCode 
)

Definition at line 55 of file shaderprogram.cpp.

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

◆ addShaderFromSourceFile()

bool ShaderProgram::addShaderFromSourceFile ( Shader::ShaderType  shaderType,
const std::string &  sourceFile 
)

Definition at line 64 of file shaderprogram.cpp.

Here is the call graph for this function:

◆ bind()

bool ShaderProgram::bind ( )

Definition at line 106 of file shaderprogram.cpp.

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

◆ bindAttributeLocation()

void ShaderProgram::bindAttributeLocation ( int  location,
const char *  name 
)

Definition at line 143 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ bindUniformLocation()

void ShaderProgram::bindUniformLocation ( int  location,
const char *  name 
)

Definition at line 148 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ disableAttributeArray() [1/2]

void ShaderProgram::disableAttributeArray ( const char *  name)
inline

Definition at line 52 of file shaderprogram.h.

Here is the call graph for this function:

◆ disableAttributeArray() [2/2]

static void ShaderProgram::disableAttributeArray ( int  location)
inlinestatic

Definition at line 50 of file shaderprogram.h.

Here is the caller graph for this function:

◆ enableAttributeArray() [1/2]

void ShaderProgram::enableAttributeArray ( const char *  name)
inline

Definition at line 53 of file shaderprogram.h.

Here is the call graph for this function:

◆ enableAttributeArray() [2/2]

static void ShaderProgram::enableAttributeArray ( int  location)
inlinestatic

Definition at line 51 of file shaderprogram.h.

Here is the caller graph for this function:

◆ getAttributeLocation()

int ShaderProgram::getAttributeLocation ( const char *  name)

Definition at line 138 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ getProgramId()

uint ShaderProgram::getProgramId ( )
inline

Definition at line 87 of file shaderprogram.h.

◆ getShaders()

ShaderList ShaderProgram::getShaders ( )
inline

Definition at line 88 of file shaderprogram.h.

◆ isLinked()

bool ShaderProgram::isLinked ( )
inline

Definition at line 86 of file shaderprogram.h.

◆ link()

bool ShaderProgram::link ( )
virtual

Reimplemented in PainterShaderProgram.

Definition at line 90 of file shaderprogram.cpp.

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

◆ log()

std::string ShaderProgram::log ( )

Definition at line 125 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ release()

void ShaderProgram::release ( )
static

Definition at line 117 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ removeAllShaders()

void ShaderProgram::removeAllShaders ( )

Definition at line 84 of file shaderprogram.cpp.

Here is the call graph for this function:

◆ removeShader()

void ShaderProgram::removeShader ( const ShaderPtr shader)

Definition at line 73 of file shaderprogram.cpp.

Here is the caller graph for this function:

◆ setAttributeArray() [1/2]

void ShaderProgram::setAttributeArray ( const char *  name,
const float *  values,
int  size,
int  stride = 0 
)
inline

Definition at line 63 of file shaderprogram.h.

Here is the call graph for this function:

◆ setAttributeArray() [2/2]

void ShaderProgram::setAttributeArray ( int  location,
const float *  values,
int  size,
int  stride = 0 
)
inline

Definition at line 59 of file shaderprogram.h.

Here is the caller graph for this function:

◆ setAttributeValue() [1/6]

void ShaderProgram::setAttributeValue ( const char *  name,
float  value 
)
inline

Definition at line 64 of file shaderprogram.h.

Here is the call graph for this function:

◆ setAttributeValue() [2/6]

void ShaderProgram::setAttributeValue ( const char *  name,
float  x,
float  y 
)
inline

Definition at line 65 of file shaderprogram.h.

Here is the call graph for this function:

◆ setAttributeValue() [3/6]

void ShaderProgram::setAttributeValue ( const char *  name,
float  x,
float  y,
float  z 
)
inline

Definition at line 66 of file shaderprogram.h.

Here is the call graph for this function:

◆ setAttributeValue() [4/6]

void ShaderProgram::setAttributeValue ( int  location,
float  value 
)
inline

Definition at line 60 of file shaderprogram.h.

◆ setAttributeValue() [5/6]

void ShaderProgram::setAttributeValue ( int  location,
float  x,
float  y 
)
inline

Definition at line 61 of file shaderprogram.h.

◆ setAttributeValue() [6/6]

void ShaderProgram::setAttributeValue ( int  location,
float  x,
float  y,
float  z 
)
inline

Definition at line 62 of file shaderprogram.h.

◆ setUniformValue() [1/16]

void ShaderProgram::setUniformValue ( const char *  name,
const Color color 
)
inline

Definition at line 76 of file shaderprogram.h.

Here is the call graph for this function:

◆ setUniformValue() [2/16]

void ShaderProgram::setUniformValue ( const char *  name,
const Matrix2 mat 
)
inline

Definition at line 82 of file shaderprogram.h.

Here is the call graph for this function:

◆ setUniformValue() [3/16]

void ShaderProgram::setUniformValue ( const char *  name,
const Matrix3 mat 
)
inline

Definition at line 83 of file shaderprogram.h.

Here is the call graph for this function:

◆ setUniformValue() [4/16]

void ShaderProgram::setUniformValue ( const char *  name,
float  value 
)
inline

Definition at line 78 of file shaderprogram.h.

◆ setUniformValue() [5/16]

void ShaderProgram::setUniformValue ( const char *  name,
float  x,
float  y 
)
inline

Definition at line 79 of file shaderprogram.h.

◆ setUniformValue() [6/16]

void ShaderProgram::setUniformValue ( const char *  name,
float  x,
float  y,
float  z 
)
inline

Definition at line 80 of file shaderprogram.h.

◆ setUniformValue() [7/16]

void ShaderProgram::setUniformValue ( const char *  name,
float  x,
float  y,
float  z,
float  w 
)
inline

Definition at line 81 of file shaderprogram.h.

◆ setUniformValue() [8/16]

void ShaderProgram::setUniformValue ( const char *  name,
int  value 
)
inline

Definition at line 77 of file shaderprogram.h.

◆ setUniformValue() [9/16]

void ShaderProgram::setUniformValue ( int  location,
const Color color 
)
inline

Definition at line 68 of file shaderprogram.h.

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

◆ setUniformValue() [10/16]

void ShaderProgram::setUniformValue ( int  location,
const Matrix2 mat 
)
inline

Definition at line 74 of file shaderprogram.h.

Here is the call graph for this function:

◆ setUniformValue() [11/16]

void ShaderProgram::setUniformValue ( int  location,
const Matrix3 mat 
)
inline

Definition at line 75 of file shaderprogram.h.

Here is the call graph for this function:

◆ setUniformValue() [12/16]

void ShaderProgram::setUniformValue ( int  location,
float  value 
)
inline

Definition at line 70 of file shaderprogram.h.

◆ setUniformValue() [13/16]

void ShaderProgram::setUniformValue ( int  location,
float  x,
float  y 
)
inline

Definition at line 71 of file shaderprogram.h.

◆ setUniformValue() [14/16]

void ShaderProgram::setUniformValue ( int  location,
float  x,
float  y,
float  z 
)
inline

Definition at line 72 of file shaderprogram.h.

◆ setUniformValue() [15/16]

void ShaderProgram::setUniformValue ( int  location,
float  x,
float  y,
float  z,
float  w 
)
inline

Definition at line 73 of file shaderprogram.h.

◆ setUniformValue() [16/16]

void ShaderProgram::setUniformValue ( int  location,
int  value 
)
inline

Definition at line 69 of file shaderprogram.h.


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