This line is a bit confusing, can you use if(actview == 0) actview = iuser->eye; else actview  = actview - 1;