37 lines
591 B
C
37 lines
591 B
C
|
|
#include <stdio.h>
|
||
|
|
#include "../headers/glut.h"
|
||
|
|
|
||
|
|
int frame_ms=16;
|
||
|
|
int one_s=1000;
|
||
|
|
int five_s=5000;
|
||
|
|
|
||
|
|
void printSomething( int value){
|
||
|
|
printf("a frame\n");
|
||
|
|
glutTimerFunc(frame_ms, printSomething, 0);
|
||
|
|
}
|
||
|
|
|
||
|
|
void printSecond( int value){
|
||
|
|
printf("a second\n");
|
||
|
|
}
|
||
|
|
|
||
|
|
void printFiveSecond( int value){
|
||
|
|
printf("five seconds\n");
|
||
|
|
}
|
||
|
|
|
||
|
|
int main(){
|
||
|
|
char *devPaths[2] = {
|
||
|
|
"/dev/input/event4",
|
||
|
|
"/dev/input/event5"
|
||
|
|
};
|
||
|
|
|
||
|
|
glutInit( devPaths, 2);
|
||
|
|
|
||
|
|
glutTimerFunc(frame_ms, printSomething, 0);
|
||
|
|
glutTimerFunc(one_s, printSecond, 0);
|
||
|
|
glutTimerFunc(five_s, printFiveSecond, 0);
|
||
|
|
|
||
|
|
glutMainLoop();
|
||
|
|
/*
|
||
|
|
*/
|
||
|
|
}
|