【发布时间】:2011-03-11 06:21:13
【问题描述】:
我正在开发一个 iphone 游戏我正在使用多线程在屏幕上绘制多个对象,但我不清楚如何使用所有这些线程渲染特定场景,我是否应该在所有线程中使用相同的 FOB 来更新场景或者是否有任何其他技术可以使用多线程渲染场景。请帮助 下面给出的代码(放置在单独的线程中)给出了错误的访问权限
-(void)drawBricks1{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[EAGLContext setCurrentContext:context];
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
//glViewport(0, 0,backingWidth, backingHeight);
Image *ii=[[Image alloc]initWithImage:[UIImage imageNamed:@"s_2.png"]];
[ii renderAtPoint:CGPointMake(100, 100) centerOfImage:YES];
// Clear screen
//glClear(GL_COLOR_BUFFER_BIT);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
[pool release];
}// end of the drawb
【问题讨论】: