Last active
August 29, 2015 14:02
-
-
Save ggmm-0/a2fb62115ee8bad9f7ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** key code constants definition **/ | |
#define LEFT_KEY_CODE 100 | |
#define RIGHT_KEY_CODE 102 | |
#define UP_KEY_CODE 101 | |
#define DOWN_KEY_CODE 103 | |
//... | |
void keyboard(int key, int x, int y) { | |
switch(key) { | |
case UP_KEY_CODE: | |
xRot -= 1.0f; | |
glutPostRedisplay(); | |
break; | |
case DOWN_KEY_CODE: | |
xRot += 1.0f; | |
glutPostRedisplay(); | |
break; | |
case RIGHT_KEY_CODE: | |
rotateRight(); | |
break; | |
case LEFT_KEY_CODE: | |
rotateLeft(); | |
break; | |
default: | |
break; | |
} | |
} | |
// w main: | |
glutSpecialFunc(keyboard); // zamiast glutKeyboardFunc(keyboard); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment