In anime basketball such as Slam Dunk, Dear Boys and Kuroko's Basketball, most of the characters with eyeglasses, play basketball without having their eyeglasses fall or broken during the game. How can this happen?
In real life, people that wear glasses often wear "sports bands" when they are concerned about their glasses flying away during athletic events. However, well fit glasses don't need any additional enhancements as long as the athlete isn't performing many rolls. Simple jumps are not enough to cause well fitting glasses to fall or fly away in this case.
In addition to that, some glasses have highly curved end pieces to help secure glasses on the wearer. These end pieces wrap further around the ears than simple straight pieces, and this helps keep the glasses secure.