rev |
line source |
nuclear@0
|
1 #ifndef SGL_H_
|
nuclear@0
|
2 #define SGL_H_
|
nuclear@0
|
3
|
nuclear@0
|
4 #define SGL_DOUBLE 1
|
nuclear@0
|
5 #define SGL_DEPTH 2
|
nuclear@0
|
6 #define SGL_STENCIL 4
|
nuclear@0
|
7 #define SGL_STEREO 8
|
nuclear@4
|
8 #define SGL_MULTISAMPLE 16
|
nuclear@0
|
9
|
nuclear@6
|
10 typedef void (*sgl_create_callback_t)(int);
|
nuclear@6
|
11 typedef void (*sgl_close_callback_t)(int);
|
nuclear@6
|
12 typedef void (*sgl_display_callback_t)(void);
|
nuclear@6
|
13 typedef void (*sgl_reshape_callback_t)(int, int);
|
nuclear@6
|
14 typedef void (*sgl_keyboard_callback_t)(int, int);
|
nuclear@6
|
15 typedef void (*sgl_mouse_callback_t)(int, int, int, int, int);
|
nuclear@6
|
16 typedef void (*sgl_motion_callback_t)(int, int, int);
|
nuclear@6
|
17 typedef void (*sgl_passive_callback_t)(int, int, int);
|
nuclear@6
|
18 typedef void (*sgl_idle_callback_t)(void);
|
nuclear@6
|
19
|
nuclear@0
|
20 enum {
|
nuclear@0
|
21 SGL_CREATE,
|
nuclear@0
|
22 SGL_CLOSE,
|
nuclear@0
|
23 SGL_DISPLAY,
|
nuclear@0
|
24 SGL_RESHAPE,
|
nuclear@0
|
25 SGL_KEYBOARD,
|
nuclear@0
|
26 SGL_MOUSE,
|
nuclear@0
|
27 SGL_MOTION,
|
nuclear@0
|
28 SGL_PASSIVE,
|
nuclear@0
|
29 SGL_IDLE,
|
nuclear@0
|
30
|
nuclear@0
|
31 SGL_NUM_CALLBACKS
|
nuclear@0
|
32 };
|
nuclear@0
|
33
|
nuclear@5
|
34 enum {
|
nuclear@5
|
35 SGL_LEFT_BUTTON,
|
nuclear@5
|
36 SGL_MIDDLE_BUTTON,
|
nuclear@5
|
37 SGL_RIGHT_BUTTON
|
nuclear@5
|
38 };
|
nuclear@5
|
39
|
nuclear@1
|
40 int sgl_init(void);
|
nuclear@5
|
41 void sgl_quit(void);
|
nuclear@1
|
42
|
nuclear@4
|
43 int sgl_set_video_mode(int xsz, int ysz);
|
nuclear@4
|
44 int sgl_get_video_mode(int *xsz, int *ysz);
|
nuclear@0
|
45
|
nuclear@4
|
46 int sgl_create_window(int xsz, int ysz, unsigned int mode);
|
nuclear@1
|
47 void sgl_close_window(int win);
|
nuclear@0
|
48
|
nuclear@4
|
49 int sgl_set_active(int id);
|
nuclear@4
|
50 int sgl_set_title(const char *str);
|
nuclear@4
|
51
|
nuclear@5
|
52 void sgl_redisplay(void);
|
nuclear@5
|
53 void sgl_swap_buffers(void);
|
nuclear@5
|
54
|
nuclear@4
|
55 int sgl_process_events(void);
|
nuclear@5
|
56 void sgl_event_loop(void);
|
nuclear@4
|
57
|
nuclear@0
|
58 int sgl_push_callbacks(void);
|
nuclear@0
|
59 int sgl_pop_callbacks(void);
|
nuclear@0
|
60 void sgl_clear_callbacks(void);
|
nuclear@4
|
61 void sgl_set_callback(int idx, void (*func)());
|
nuclear@4
|
62 void (*sgl_get_callback(int idx))();
|
nuclear@0
|
63
|
nuclear@6
|
64 void sgl_create_callback(sgl_create_callback_t func);
|
nuclear@6
|
65 void sgl_close_callback(sgl_close_callback_t func);
|
nuclear@6
|
66 void sgl_display_callback(sgl_display_callback_t func);
|
nuclear@6
|
67 void sgl_reshape_callback(sgl_reshape_callback_t func);
|
nuclear@6
|
68 void sgl_keyboard_callback(sgl_keyboard_callback_t func);
|
nuclear@6
|
69 void sgl_mouse_callback(sgl_mouse_callback_t func);
|
nuclear@6
|
70 void sgl_motion_callback(sgl_motion_callback_t func);
|
nuclear@6
|
71 void sgl_passive_callback(sgl_passive_callback_t func);
|
nuclear@6
|
72 void sgl_idle_callback(sgl_idle_callback_t func);
|
nuclear@6
|
73
|
nuclear@0
|
74 #endif /* SGL_H_ */
|