int boundaryModeR,
float boundaryRed,
float boundaryGreen,
float boundaryBlue,
float boundaryAlpha) {
GL gl = context(ctx).getGL();
// set texture wrap parameter
switch (boundaryModeS) {
case Texture.WRAP:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
break;
case Texture.CLAMP:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP);
break;
case Texture.CLAMP_TO_EDGE:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S,
GL.GL_CLAMP_TO_EDGE);
break;
case Texture.CLAMP_TO_BOUNDARY:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S,
GL2.GL_CLAMP_TO_BORDER);
break;
}
switch (boundaryModeT) {
case Texture.WRAP:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT);
break;
case Texture.CLAMP:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP);
break;
case Texture.CLAMP_TO_EDGE:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T,
GL.GL_CLAMP_TO_EDGE);
break;
case Texture.CLAMP_TO_BOUNDARY:
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T,
GL2.GL_CLAMP_TO_BORDER);
break;
}
// applies to Texture3D only
if (boundaryModeR != -1) {
switch (boundaryModeR) {
case Texture.WRAP:
gl.glTexParameteri(target,
GL2.GL_TEXTURE_WRAP_R, GL.GL_REPEAT);
break;
case Texture.CLAMP:
gl.glTexParameteri(target,
GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP);
break;
case Texture.CLAMP_TO_EDGE:
gl.glTexParameteri(target,
GL2.GL_TEXTURE_WRAP_R,
GL.GL_CLAMP_TO_EDGE);
break;
case Texture.CLAMP_TO_BOUNDARY:
gl.glTexParameteri(target,
GL2.GL_TEXTURE_WRAP_R,
GL2.GL_CLAMP_TO_BORDER);
break;
}
}
if (boundaryModeS == Texture.CLAMP ||
boundaryModeT == Texture.CLAMP ||
boundaryModeR == Texture.CLAMP) {
// set texture border color
float[] color = new float[4];
color[0] = boundaryRed;
color[1] = boundaryGreen;
color[2] = boundaryBlue;
color[3] = boundaryAlpha;
gl.glTexParameterfv(target, GL2.GL_TEXTURE_BORDER_COLOR, color, 0);
}
}