-
Notifications
You must be signed in to change notification settings - Fork 3
/
rubik.pas
47 lines (37 loc) · 856 Bytes
/
rubik.pas
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
Program rubik;
Uses algorithm, RubiksCube, input, graphics, glut;
Var c: Cube;
Procedure DrawCallback;
cdecl;
Begin
RedrawScreen(c);
End;
Procedure KeyboardCallback(Key: Byte; X, Y: Longint);
cdecl;
Begin
ProcessKeyboard(key, X, Y, c);
DrawCallback;
End;
Procedure MouseCallback(button, state, x ,y:longint);
cdecl;
Begin
writeln(button);
writeln(state);
writeln(x, ' ', y);
ProcessMouse(button, state, x, y, c);
End;
Procedure MotionCallback(x, y:longint);
cdecl;
Begin
writeln(x, ' ', y);
ProcessMouseMotion(x, y, c);
End;
Begin
StartingCube(c);
glutDisplayFunc(@DrawCallback);
glutReshapeFunc(@ReSizeGLScene);
glutKeyboardFunc(@KeyboardCallback);
glutMouseFunc(@MouseCallback);
glutMotionFunc(@MotionCallback);
glutMainLoop;
End.