Skip to content

Commit

Permalink
added another helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor committed Feb 1, 2010
1 parent 3e087af commit c0a5a1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions processing.js
Expand Up @@ -1923,6 +1923,18 @@

p.PVector = PVector;

function uniformi(programObj, varName, varValue)
{
var varLocation = curContext.getUniformLocation(programObj, varName);
// the variable won't be found if it was optimized out.
if( varLocation !== -1)
{
if (varValue.length == 4){curContext.uniform4iv(varLocation, varValue);}
else if (varValue.length == 3){curContext.uniform3iv(varLocation, varValue);}
else if (varValue.length == 2){curContext.uniform2iv(varLocation, varValue);}
else {curContext.uniform1i (varLocation, varValue);}
}
}

////////////////////////////////////////////////////////////////////////////
// Style functions
Expand Down

0 comments on commit c0a5a1d

Please sign in to comment.