Hello… I have just started using GLUT, and I can’t figure out how I can make to have on the screen two object at the same time, that are “activated” by keyboard…
Lets say i have 2 cubes, one appears on ‘a’ one on ‘b’… But when I press ‘b’, the 1st one dissapears… I can’t really figure it out…
GLUT does not control OpenGL drawing; you control what is drawn by the code inside the procedure set in glutDisplayFunc. If you want 2 cubes draw you must draw 2 cubes each time that procedure is called. You may need to post this procedure if you want more information
As tonyo_au already pointed out you see only one cube as you only draw one: as the variable “tasta” may only hold one value it may be either ‘a’ or ‘s’ (or something else in which case probably nothing is displayed).