Skip to content

Commit

Permalink
added uniformMatrix. Ticket: https://processing-js.lighthouseapp.com/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor committed Feb 1, 2010
1 parent 3e087af commit b74f3e7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1923,7 +1923,17 @@

p.PVector = PVector;


function uniformMatrix(programObj, varName, transpose, matrix)
{
var varLocation = curContext.getUniformLocation(programObj, varName);
// the variable won't be found if it was optimized out.
if( varLocation !== -1)
{
if (matrix.length === 16){curContext.uniformMatrix4fv(varLocation, transpose, matrix);}
else if (matrix.length === 9){curContext.uniformMatrix3fv(varLocation, transpose, matrix);}
else {curContext.uniformMatrix2fv(varLocation, transpose, matrix);}
}
}
////////////////////////////////////////////////////////////////////////////
// Style functions
////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit b74f3e7

Please sign in to comment.