sgl

view include/sgl.h @ 6:0cb438c86b98

X11 sounds about ready
author John Tsiombikas <nuclear@siggraph.org>
date Fri, 13 May 2011 09:44:21 +0300
parents 0570e27e5ebc
children edbfc96fe80d
line source
1 #ifndef SGL_H_
2 #define SGL_H_
4 #define SGL_DOUBLE 1
5 #define SGL_DEPTH 2
6 #define SGL_STENCIL 4
7 #define SGL_STEREO 8
8 #define SGL_MULTISAMPLE 16
10 typedef void (*sgl_create_callback_t)(int);
11 typedef void (*sgl_close_callback_t)(int);
12 typedef void (*sgl_display_callback_t)(void);
13 typedef void (*sgl_reshape_callback_t)(int, int);
14 typedef void (*sgl_keyboard_callback_t)(int, int);
15 typedef void (*sgl_mouse_callback_t)(int, int, int, int, int);
16 typedef void (*sgl_motion_callback_t)(int, int, int);
17 typedef void (*sgl_passive_callback_t)(int, int, int);
18 typedef void (*sgl_idle_callback_t)(void);
20 enum {
21 SGL_CREATE,
22 SGL_CLOSE,
23 SGL_DISPLAY,
24 SGL_RESHAPE,
25 SGL_KEYBOARD,
26 SGL_MOUSE,
27 SGL_MOTION,
28 SGL_PASSIVE,
29 SGL_IDLE,
31 SGL_NUM_CALLBACKS
32 };
34 enum {
35 SGL_LEFT_BUTTON,
36 SGL_MIDDLE_BUTTON,
37 SGL_RIGHT_BUTTON
38 };
40 int sgl_init(void);
41 void sgl_quit(void);
43 int sgl_set_video_mode(int xsz, int ysz);
44 int sgl_get_video_mode(int *xsz, int *ysz);
46 int sgl_create_window(int xsz, int ysz, unsigned int mode);
47 void sgl_close_window(int win);
49 int sgl_set_active(int id);
50 int sgl_set_title(const char *str);
52 void sgl_redisplay(void);
53 void sgl_swap_buffers(void);
55 int sgl_process_events(void);
56 void sgl_event_loop(void);
58 int sgl_push_callbacks(void);
59 int sgl_pop_callbacks(void);
60 void sgl_clear_callbacks(void);
61 void sgl_set_callback(int idx, void (*func)());
62 void (*sgl_get_callback(int idx))();
64 void sgl_create_callback(sgl_create_callback_t func);
65 void sgl_close_callback(sgl_close_callback_t func);
66 void sgl_display_callback(sgl_display_callback_t func);
67 void sgl_reshape_callback(sgl_reshape_callback_t func);
68 void sgl_keyboard_callback(sgl_keyboard_callback_t func);
69 void sgl_mouse_callback(sgl_mouse_callback_t func);
70 void sgl_motion_callback(sgl_motion_callback_t func);
71 void sgl_passive_callback(sgl_passive_callback_t func);
72 void sgl_idle_callback(sgl_idle_callback_t func);
74 #endif /* SGL_H_ */