-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinput.h
52 lines (43 loc) · 1.36 KB
/
input.h
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
/* Base graphics library for coursework *
* INPUT
*/
#ifndef INPUT_H
#define INPUT_H
#include <GLUT/glut.h>
#include "point.h"
/* User-defined callback functions should NOT free the pointer pos_p.
* The pointer variable pos_p is the comunicator between the two layer of
* the software, so I decided to free the pointer at the lower-level caller
* function to keep the simplicity in higher-level code.
*/
void bg_menu_callback(int value);
void bg_menu_bind(
char * title,
void (*callback)());
void bg_mouse_plot_callback(
GLint button,
GLint action,
GLint xMouse,
GLint yMouse);
void bg_mouse_press_bind(void (*callback)(struct bg_point *));
void bg_mouse_release_bind(void (*callback)(struct bg_point *));
/* "Move" means moving cursor without left-click.
* "Drag" means moving cursor with left-click.
*/
void bg_mouse_move_callback(
GLint xMouse,
GLint yMouse);
void bg_mouse_drag_callback(
GLint xMouse,
GLint yMouse);
void bg_mouse_move_bind(void (*callback)(struct bg_point *));
void bg_mouse_drag_bind(void (*callback)(struct bg_point *));
void bg_keyboard_callback(
unsigned char key,
int x,
int y);
/* The best is to use characters, digits or space as a key. */
void bg_keyboard_bind(
unsigned char key,
void (*callback)());
#endif /* INPUT_H */