• Advertisement
Sign in to follow this  

iOS multi-touch problem

This topic is 2218 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi experts!

I am using:
- xCode 4.3.1
- OpenGLES 2.0

I have encountered a problem, and do not find any clear solution.
I've set up multitouch methods and they are working fine except the the given positions are wrong.


.
.
.
GLKView *view = (GLKView *)self.view;
view.context = self.context;
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
view.multipleTouchEnabled = true;
.
.
.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSSet *allTouches = [event allTouches];
UITouch *touch = [[UITouch alloc] init];
CGPoint currentTouch;

NSLog(@"---------");
NSLog(@"at:%d",[allTouches count]);

for (int nTouch = 0; nTouch < [allTouches count]; nTouch++)
{
touch = [[allTouches allObjects] objectAtIndex:nTouch];
currentTouch = [touch locationInView:[touch view]];
NSLog(@"x:%f y:%f", currentTouch.x, currentTouch.y);
}
}


The first touch is ok, but the others are not,and they gave me positions like the first one, or very similar.
On the net I've find documents and posts, that maybe I need other layers than [touch view], but I do not know if it is true or not, and how to do that in OpenGLES.

Any answers are welcome!!!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement