GLKView
ユーザー描画用のサブクラスがあります。しかし、彼が適切な画面を開いたときに、彼の最新の描画イメージも描画する必要があります。問題は2番目の部分にあります。動作しない原因となる何か間違ったことをしているようですdrawImage:inRect:fromRect:
。
これが私の描画用のコードです。
-(void)setSignatureImage:(UIImage *)image {
EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
self.context = context;
[EAGLContext setCurrentContext:context];
self.drawableDepthFormat = GLKViewDrawableDepthFormat24;
self.enableSetNeedsDisplay = YES;
CIContext *cicontext = [CIContext contextWithEAGLContext:context options:@{kCIContextWorkingColorSpace : [NSNull null]} ];
UIImage *pre_img = image;
CIImage *outputImage = [CIImage imageWithCGImage:pre_img.CGImage];
if (outputImage) {
[cicontext drawImage:outputImage inRect:[outputImage extent] fromRect:[outputImage extent]];
}
}