Jump to content

  • Log In with Google      Sign In   
  • Create Account

iOS multi-touch problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Vorel512   Members   -  Reputation: 130

Like
0Likes
Like

Posted 26 March 2012 - 06:34 AM

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!!!

Sponsor:

#2 Vorel512   Members   -  Reputation: 130

Like
0Likes
Like

Posted 27 March 2012 - 12:00 AM

Okay, I've found out, that touches is only enabled in OpenGL view, so I should pass that view to the touch locationInView.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS