istereo2
diff src/ios/viewctl.m @ 6:3bccfc7d10fe
goatkit is drawing
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 23 Sep 2015 05:44:58 +0300 |
parents | 6a39b8912752 |
children | 1b7776cb800b |
line diff
1.1 --- a/src/ios/viewctl.m Tue Sep 22 07:13:47 2015 +0300 1.2 +++ b/src/ios/viewctl.m Wed Sep 23 05:44:58 2015 +0300 1.3 @@ -152,6 +152,34 @@ 1.4 printf("viewport %dx%d (scale: %g)\n", xsz, ysz, pixel_scale); 1.5 } 1.6 1.7 +- (void)touchesBegan: (NSSet<UITouch*>*)touches withEvent: (UIEvent*)event 1.8 +{ 1.9 + UITouch *touch = [touches anyObject]; 1.10 + CGPoint pt = [touch locationInView: nil]; 1.11 + mouse_button(0, 1, pt.x, pt.y); 1.12 +} 1.13 + 1.14 +- (void)touchesMoved: (NSSet<UITouch*>*)touches withEvent: (UIEvent*)event 1.15 +{ 1.16 + UITouch *touch = [touches anyObject]; 1.17 + CGPoint pt = [touch locationInView: nil]; 1.18 + mouse_motion(pt.x, pt.y); 1.19 +} 1.20 + 1.21 +- (void)touchesEnded: (NSSet<UITouch*>*)touches withEvent: (UIEvent*)event 1.22 +{ 1.23 + UITouch *touch = [touches anyObject]; 1.24 + CGPoint pt = [touch locationInView: nil]; 1.25 + mouse_button(0, 0, pt.x, pt.y); 1.26 +} 1.27 + 1.28 +- (void)touchesCancelled: (NSSet<UITouch*>*)touches withEvent: (UIEvent*)event 1.29 +{ 1.30 + UITouch *touch = [touches anyObject]; 1.31 + CGPoint pt = [touch locationInView: nil]; 1.32 + mouse_button(0, 0, pt.x, pt.y); 1.33 +} 1.34 + 1.35 // ADBannerDelegate functions 1.36 1.37 - (void)bannerViewDidLoadAd: (ADBannerView*)banner