The glutKeyboardFunc does not react to key presses immediately
- by Nibirue
I have a function glutKeyboardFunc(keyboard), where keyboard has:
void keyboard(unsigned char key, int x, int y){
float alpha = 1.0;
switch(key){
case 'c':
glClearColor(1,0,0,alpha);
printf("success");
break;
}
}
This is a summary of the function; it works properly, but only once some other action has occurred. For instance, the printf statement reports success immediately on keystroke 'c', but the background color does not become active until I click somewhere else on the canvas. I want all keystrokes to have an immediate effect.