dispatch_async(dispatch_get_main_queue(), ^{
CGContextClearRect(context, CGRectMake(0, 0,width , height));
[[[UIApplication sharedApplication].delegate window].layer renderInContext:context];
[[UIApplication sharedApplication].delegate window].layer.contents = self.sceneView;
CGImageRef cgImage = CGBitmapContextCreateImage(context);
UIImage* image = [UIImage imageWithCGImage: cgImage];
self.sceneTexture=[self texture2DWithImage:image device:self.device];
CGImageRelease(cgImage);
});
在调用一些方法时,有时必须在主线程内进行,比如在做录屏效果时,这种方法就可以实现。
目前对oc开发整体框架没时间研究,只能用哪,临时了解一下吧!
4626

被折叠的 条评论
为什么被折叠?



