project for a (works on my devices) demo
This commit is contained in:
36
sources/demos/demo_headless.c
Normal file
36
sources/demos/demo_headless.c
Normal file
@@ -0,0 +1,36 @@
|
||||
#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();
|
||||
/*
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user