-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
71 lines (46 loc) · 1.13 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <GL/glut.h>
#include "display.h"
#include "events.h"
#include "init.h"
#include "WiiInterface/WiiInterface.h"
#include "config.h"
#include <unistd.h>
int useWiiMotes;
int main(int argc, char *argv[])
{
int windowWidth = 1024;
int windowHeight = 768;
useWiiMotes = 1;
/* Process Arguments */
int option_char;
while((option_char = getopt(argc, argv, "nw:h:")) != -1)
{
switch (option_char)
{
case 'n': useWiiMotes = 0; break;
case 'w': windowWidth = atoi(optarg);
case 'h': windowHeight = atoi(optarg);
}
}
/* Connect Wii Motes */
if(useWiiMotes)
StartWiiMotes();
/* Setup Window */
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(windowWidth, windowHeight);
glutInitWindowPosition(0,0);
glutCreateWindow("WiiControl");
//glutFullScreen();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMouseFunc(mouse);
glutKeyboardFunc(keyboard);
glutSpecialFunc(specialKeyboard);
glutIdleFunc(display);
/* Intialize everything */
init();
/* Enter Game Loop */
glutMainLoop();
ShutDown();
}