sgl
diff include/sgl.h @ 39:e1a27aa24956
fixed broken build
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Wed, 27 Jun 2012 05:54:57 +0300 |
parents | 9841c90ec769 |
children | f7de32814f34 |
line diff
1.1 --- a/include/sgl.h Wed Jun 27 05:16:25 2012 +0300 1.2 +++ b/include/sgl.h Wed Jun 27 05:54:57 2012 +0300 1.3 @@ -15,31 +15,50 @@ 1.4 1.5 /* Create callback is called just after a window and its OpenGL context is created */ 1.6 typedef void (*sgl_create_callback_t)(int window); 1.7 + 1.8 /* Close callback is called before the window and its OpenGL context is destroyed */ 1.9 typedef void (*sgl_close_callback_t)(int window); 1.10 + 1.11 /* The display callback is called whenever the window needs repainting. This is 1.12 * the only place you should perform drawing. 1.13 */ 1.14 typedef void (*sgl_display_callback_t)(void); 1.15 + 1.16 /* Reshape is called whenever the window size changes, and at least once for 1.17 * each newly created window, just after the call to the create callback. */ 1.18 typedef void (*sgl_reshape_callback_t)(int width, int height); 1.19 + 1.20 /* The keyboard callback is called whenever a key is pressed or released */ 1.21 typedef void (*sgl_keyboard_callback_t)(int key, int pressed); 1.22 + 1.23 /* The mouse callback is called whenever a mouse button is pressed or released 1.24 * over the window. The first argument is the touch id for multitouch devices. 1.25 * For regular mouse events it is always 0. */ 1.26 typedef void (*sgl_mouse_callback_t)(int id, int button, int pressed, int x, int y); 1.27 + 1.28 /* The motion callback is called when the user drags the mouse around with any 1.29 * mouse buttons held down. The first argument is the touch id for multitouch 1.30 * devices. */ 1.31 typedef void (*sgl_motion_callback_t)(int id, int x, int y); 1.32 + 1.33 /* Passive gets called whenever the mouse is moved without any button being 1.34 * held. The first argument is the touch id for multitouch devices. 1.35 * 1.36 * Avoid setting this callback unless absolutely necessary, because it will 1.37 * generate a huge volume of events whenever the mouse moves over the window. */ 1.38 typedef void (*sgl_passive_callback_t)(int id, int x, int y); 1.39 + 1.40 +/* The space control callback gets called when we receive input from spatial 1.41 + * controllers such as spaceballs, accelerometers, and gyroscopes 1.42 + */ 1.43 +typedef void (*sgl_space_callback_t)(int x, int y, int z, int rx, int ry, int rz); 1.44 + 1.45 +/* The button callback gets called whenever we have button presses/releases 1.46 + * from special hardware buttons such as the home button on mobile devices, 1.47 + * buttons on spaceballs, etc. 1.48 + */ 1.49 +typedef void (*sgl_button_callback_t)(int bn, int pressed); 1.50 + 1.51 /* Setting the idle callback will change the behaviour of the library. Instead 1.52 * of blocking, to wait for events from the window system, it will poll for 1.53 * events and after processing them will call this idle callback. 1.54 @@ -59,6 +78,8 @@ 1.55 SGL_MOUSE, 1.56 SGL_MOTION, 1.57 SGL_PASSIVE, 1.58 + SGL_SPACE, 1.59 + SGL_BUTTON, 1.60 SGL_IDLE, 1.61 1.62 SGL_NUM_CALLBACKS 1.63 @@ -117,6 +138,8 @@ 1.64 void sgl_mouse_callback(sgl_mouse_callback_t func); 1.65 void sgl_motion_callback(sgl_motion_callback_t func); 1.66 void sgl_passive_callback(sgl_passive_callback_t func); 1.67 +void sgl_space_callback(sgl_space_callback_t func); 1.68 +void sgl_button_callback(sgl_button_callback_t func); 1.69 void sgl_idle_callback(sgl_idle_callback_t func); 1.70 1.71 #endif /* SGL_H_ */