내가 일반 OpenGL을/EAGL 설치가 진행이 작동하지 않음 : 구현 touchesEnded/취소 /뿐만 아니라iOS의 멀티 터치는
@interface EAGLView : UIView {
@public
EAGLContext* context;
}
@property (nonatomic, retain) EAGLContext* context;
@end
@implementation EAGLView
@synthesize context;
+ (Class)layerClass {
return [CAEAGLLayer class];
}
@end
@interface EAGLViewController : UIViewController {
@public
EAGLView* glView;
}
@property(nonatomic, retain) EAGLView* glView;
@end
@implementation EAGLViewController
@synthesize glView;
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
for (UITouch* touch in touches) {
CGPoint location = [touch locationInView:glView];
int index;
for (index = 0; index < gCONST_CURSOR_COUNT; ++index) {
if (sCursor[index] == NULL) {
sCursor[index] = touch;
break;
}
}
}
[super touchesBegan:touches withEvent:event];
}
을 이전 상응 포함. 코드가 제대로 작동하고 잘 추적됩니다.
나는 또한 모든 것을 적절한 값을주는거야 있는지 확인하십시오
sViewController = [EAGLViewController alloc];
CGRect rect = [[UIScreen mainScreen] applicationFrame];
sViewController.glView = [[EAGLView alloc] initWithFrame:CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)];
Assert(sViewController.glView);
sViewController.glView.userInteractionEnabled = YES;
sViewController.glView.multipleTouchEnabled = YES;
sViewController.glView.exclusiveTouch = YES;
을 그것은 모두가 잘 컴파일,하지만 난 결코 이상의 UITouch를 수신하지거야. 단 하나의 touchesBegan을 의미하는 것은 아니지만 색인은 0을지나 가지 않습니다. 두 번째 손가락이 그 기능을 시작하면 두 번째로 중단 점을 설정하고 손가락 두 개를 놓으면 트리거가되지 않습니다.
왜이 줄을 추가하면 문제가 해결되었는지 설명해주십시오. – rgettman
보기가보기 컨트롤러와 직접 연결되어 있지 않은 것으로 보입니다. 멀티 터치가 제대로 작동하지 않았습니다. –