1 module allegro5.touch_input; 2 3 import allegro5.base; 4 import allegro5.events; 5 import allegro5.display; 6 7 extern (C) 8 { 9 /* Maximum number of simultaneous touches. */ 10 const size_t ALLEGRO_TOUCH_INPUT_MAX_TOUCH_COUNT = 16; 11 12 struct ALLEGRO_TOUCH_INPUT {}; 13 14 struct ALLEGRO_TOUCH_STATE 15 { 16 /* (id) An identifier of touch. If touch is valid this number is positive. 17 * (x, y) Touch position on the screen in 1:1 resolution. 18 * (dx, dy) Relative touch position. 19 * (primary) True, if touch is a primary one (usually first one). 20 * (display) Display at which the touch belong. 21 */ 22 int id; 23 float x, y; 24 float dx, dy; 25 bool primary; 26 ALLEGRO_DISPLAY* display; 27 } 28 29 struct ALLEGRO_TOUCH_INPUT_STATE 30 { 31 ALLEGRO_TOUCH_STATE[ALLEGRO_TOUCH_INPUT_MAX_TOUCH_COUNT] touches; 32 } 33 34 enum ALLEGRO_MOUSE_EMULATION_MODE 35 { 36 ALLEGRO_MOUSE_EMULATION_NONE, 37 ALLEGRO_MOUSE_EMULATION_TRANSPARENT, 38 ALLEGRO_MOUSE_EMULATION_INCLUSIVE, 39 ALLEGRO_MOUSE_EMULATION_EXCLUSIVE, 40 ALLEGRO_MOUSE_EMULATION_5_0_x 41 } 42 43 44 bool al_is_touch_input_installed(); 45 bool al_install_touch_input(); 46 void al_uninstall_touch_input(); 47 void al_get_touch_input_state(ALLEGRO_TOUCH_INPUT_STATE* ret_state); 48 49 void al_set_mouse_emulation_mode(int mode); 50 int al_get_mouse_emulation_mode(); 51 52 ALLEGRO_EVENT_SOURCE* al_get_touch_input_event_source(); 53 ALLEGRO_EVENT_SOURCE* al_get_touch_input_mouse_emulation_event_source(); 54 } 55