mirror of https://github.com/axmolengine/axmol.git
add setUniformLocationWithMatrix2fv, setUniformLocationWithMatrix3fv mothed in GLProgram class.
This commit is contained in:
parent
b7dcf51af3
commit
693257fffe
|
@ -512,6 +512,24 @@ void GLProgram::setUniformLocationWith4fv(GLint location, GLfloat* floats, unsig
|
|||
}
|
||||
}
|
||||
|
||||
void GLProgram::setUniformLocationWithMatrix2fv(GLint location, GLfloat* matrixArray, unsigned int numberOfMatrices) {
|
||||
bool updated = updateUniformLocation(location, matrixArray, sizeof(float)*4*numberOfMatrices);
|
||||
|
||||
if( updated )
|
||||
{
|
||||
glUniformMatrix2fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray);
|
||||
}
|
||||
}
|
||||
|
||||
void GLProgram::setUniformLocationWithMatrix3fv(GLint location, GLfloat* matrixArray, unsigned int numberOfMatrices) {
|
||||
bool updated = updateUniformLocation(location, matrixArray, sizeof(float)*9*numberOfMatrices);
|
||||
|
||||
if( updated )
|
||||
{
|
||||
glUniformMatrix3fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GLProgram::setUniformLocationWithMatrix4fv(GLint location, GLfloat* matrixArray, unsigned int numberOfMatrices)
|
||||
{
|
||||
|
|
|
@ -198,6 +198,12 @@ public:
|
|||
/** calls glUniform4fv only if the values are different than the previous call for this same shader program. */
|
||||
void setUniformLocationWith4fv(GLint location, GLfloat* floats, unsigned int numberOfArrays);
|
||||
|
||||
/** calls glUniformMatrix2fv only if the values are different than the previous call for this same shader program. */
|
||||
void setUniformLocationWithMatrix2fv(GLint location, GLfloat* matrixArray, unsigned int numberOfMatrices);
|
||||
|
||||
/** calls glUniformMatrix3fv only if the values are different than the previous call for this same shader program. */
|
||||
void setUniformLocationWithMatrix3fv(GLint location, GLfloat* matrixArray, unsigned int numberOfMatrices);
|
||||
|
||||
/** calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. */
|
||||
void setUniformLocationWithMatrix4fv(GLint location, GLfloat* matrixArray, unsigned int numberOfMatrices);
|
||||
|
||||
|
|
Loading…
Reference in New Issue