Seperate ProgramVertex from RenderScript.java and merge ProgramVertexAlloc into the ProgramVertex class.

This commit is contained in:
Jason Sams
2009-08-04 18:47:46 -07:00
parent a2136d6b18
commit 110195fe9f
9 changed files with 244 additions and 216 deletions

View File

@ -26,6 +26,8 @@ import android.util.Log;
*
**/
public class ProgramFragment extends BaseObj {
public static final int MAX_SLOT = 2;
public enum EnvMode {
REPLACE (0),
MODULATE (1),
@ -48,17 +50,26 @@ public class ProgramFragment extends BaseObj {
mID = 0;
}
public void bindTexture(Allocation va, int slot) {
public void bindTexture(Allocation va, int slot)
throws IllegalArgumentException {
if((slot < 0) || (slot >= MAX_SLOT)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
mRS.nProgramFragmentBindTexture(mID, slot, va.mID);
}
public void bindSampler(Sampler vs, int slot) {
public void bindSampler(Sampler vs, int slot)
throws IllegalArgumentException {
if((slot < 0) || (slot >= MAX_SLOT)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
mRS.nProgramFragmentBindSampler(mID, slot, vs.mID);
}
public static class Builder {
public static final int MAX_SLOT = 2;
RenderScript mRS;
Element mIn;
Element mOut;