final GL gl = GLContext.getCurrentGL();
if (!unitRecord.isValid() || unitRecord.enabled[Type.TwoDimensional.ordinal()]) {
// Check we are in the right unit
checkAndSetUnit(unit, record, caps);
gl.glDisable(GL.GL_TEXTURE_2D);
unitRecord.enabled[Type.TwoDimensional.ordinal()] = false;
}
if (!unitRecord.isValid() || unitRecord.enabled[Type.OneDimensional.ordinal()]) {
// Check we are in the right unit