void updateTextureFilterModes(Context ctx,
int target,
int minFilter,
int magFilter) {
GL gl = context(ctx).getGL();
if (EXTRA_DEBUGGING) {
System.err.println("minFilter: " + getFilterName(minFilter) +
" magFilter: " + getFilterName(magFilter));
}
// FIXME: unclear whether we really need to set up the enum values
// in the JoglContext as is done in the native code depending on
// extension availability; maybe this is the defined fallback
// behavior of the various Java3D modes
// set texture min filter
switch (minFilter) {
case Texture.FASTEST:
case Texture.BASE_LEVEL_POINT:
gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
break;
case Texture.BASE_LEVEL_LINEAR:
gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
break;
case Texture.MULTI_LEVEL_POINT:
gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER,
GL.GL_NEAREST_MIPMAP_NEAREST);
break;
case Texture.NICEST:
case Texture.MULTI_LEVEL_LINEAR:
gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER,
GL.GL_LINEAR_MIPMAP_LINEAR);
break;
case Texture.FILTER4:
// We should never get here as we've disabled the FILTER4 feature
// gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER,
// GL.GL_FILTER4_SGIS);
break;
}
// set texture mag filter
switch (magFilter) {
case Texture.FASTEST:
case Texture.BASE_LEVEL_POINT:
gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
break;
case Texture.NICEST:
case Texture.BASE_LEVEL_LINEAR:
gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
break;
case Texture.LINEAR_SHARPEN:
// We should never get here as we've disabled the TEXTURE_SHARPEN feature
// gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER,
// GL.GL_LINEAR_SHARPEN_SGIS);