improved error checking while presenting RenderBuffer.

This commit is contained in:
rachytski 2011-09-08 14:02:08 +03:00 committed by Alex Zolotarev
parent 96c14e00ed
commit 15fc30e924

View file

@ -37,12 +37,18 @@ namespace iphone
void RenderBuffer::present()
{
makeCurrent();
const int maxTryCount = 100;
int tryCount = 0;
while (!([m_renderContext->getEAGLContext() presentRenderbuffer:GL_RENDERBUFFER_OES])
&& (tryCount++ < 100));
&& (tryCount++ < maxTryCount));
if (tryCount != 0)
NSLog(@"renderBuffer was presented from %d try", tryCount);
if (tryCount == maxTryCount + 1)
NSLog(@"failed to present renderbuffer");
else
if (tryCount != 0)
NSLog(@"renderBuffer was presented from %d try", tryCount);
}
unsigned RenderBuffer::width() const