Float Angle=0.0;
Void Ranger: : pressKey (unsigned char keys) {
If (keys=='a') Angle +=10;
If (keys=='d') Angle -=10;
}
Void Ranger: : display () {
.
GlPushMatrix ();
GlTranslatef (0.0 0.0 f, 1.5 f, f);
GlColor3f (0.3 0.5 f, 1.0 f, f);
GlScalef (1.0, 1.0, 1.0);
GlRotatef (Angle, 0.0, 1.0, 0.0);
GlutSolidCube (2);
GlPopMatrix ();
.
}
But no response after the keyboard input
CodePudding user response:
Set a breakpoint or add log debug,