sgl

annotate include/sgl.h @ 27:25de96fb1526

compiles on windows
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 27 Jun 2011 12:31:09 +0300
parents 0cb438c86b98
children 9841c90ec769
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@7 40 /* these values happen to coincide with X11 keysyms */
nuclear@7 41 #define SGL_KEY_LSHIFT 0xffe1
nuclear@7 42 #define SGL_KEY_RSHIFT 0xffe2
nuclear@7 43 #define SGL_KEY_LCONTROL 0xffe3
nuclear@7 44 #define SGL_KEY_RCONTROL 0xffe4
nuclear@7 45 #define SGL_KEY_LALT 0xffe9
nuclear@7 46 #define SGL_KEY_RALT 0xffea
nuclear@7 47
nuclear@7 48 /* for the sgl_modifiers bitmask */
nuclear@7 49 #define SGL_MOD_SHIFT 1
nuclear@7 50 #define SGL_MOD_CONTROL 2
nuclear@7 51 #define SGL_MOD_ALT 4
nuclear@7 52
nuclear@1 53 int sgl_init(void);
nuclear@5 54 void sgl_quit(void);
nuclear@1 55
nuclear@4 56 int sgl_set_video_mode(int xsz, int ysz);
nuclear@4 57 int sgl_get_video_mode(int *xsz, int *ysz);
nuclear@0 58
nuclear@4 59 int sgl_create_window(int xsz, int ysz, unsigned int mode);
nuclear@1 60 void sgl_close_window(int win);
nuclear@0 61
nuclear@4 62 int sgl_set_active(int id);
nuclear@4 63 int sgl_set_title(const char *str);
nuclear@4 64
nuclear@5 65 void sgl_redisplay(void);
nuclear@5 66 void sgl_swap_buffers(void);
nuclear@5 67
nuclear@7 68 int sgl_modifiers(void);
nuclear@7 69
nuclear@4 70 int sgl_process_events(void);
nuclear@5 71 void sgl_event_loop(void);
nuclear@4 72
nuclear@0 73 int sgl_push_callbacks(void);
nuclear@0 74 int sgl_pop_callbacks(void);
nuclear@0 75 void sgl_clear_callbacks(void);
nuclear@4 76 void sgl_set_callback(int idx, void (*func)());
nuclear@4 77 void (*sgl_get_callback(int idx))();
nuclear@0 78
nuclear@6 79 void sgl_create_callback(sgl_create_callback_t func);
nuclear@6 80 void sgl_close_callback(sgl_close_callback_t func);
nuclear@6 81 void sgl_display_callback(sgl_display_callback_t func);
nuclear@6 82 void sgl_reshape_callback(sgl_reshape_callback_t func);
nuclear@6 83 void sgl_keyboard_callback(sgl_keyboard_callback_t func);
nuclear@6 84 void sgl_mouse_callback(sgl_mouse_callback_t func);
nuclear@6 85 void sgl_motion_callback(sgl_motion_callback_t func);
nuclear@6 86 void sgl_passive_callback(sgl_passive_callback_t func);
nuclear@6 87 void sgl_idle_callback(sgl_idle_callback_t func);
nuclear@6 88
nuclear@0 89 #endif /* SGL_H_ */