im a few month into opengl now and im working on a small 2 player game. the first player moves with awsd, the 2nd with ijkl
and im using the glutkeyboardfunc().
my problem is now that it isnt possible to press 2 buttons simultaneous. so at the moment, if you move, and the other player presses a button you get interrupted.
how can i make it possible that both players have full controll and dont get interuppted by the other?
void keyboard(unsigned char key, int x, int y){
switch (key) {
case ' ':
player1.shoot();
break;
case 'a':
player1.rotateY(+3);
break;
case 'd':
player1.rotateY(-3);
break;
//player 2
case '.':
player2.shoot();
break;
case 'h':
player2.rotateY(+3);
break;
case 'k':
player2.rotateY(-3);
break;
etc....
}
}
so how should i change that?
if there is no other way, i will try it with glfw. but im using many glut operations, so it will cost me much time to change all my already written code!