forked from organicmaps/organicmaps
improved error checking while presenting RenderBuffer.
This commit is contained in:
parent
96c14e00ed
commit
15fc30e924
1 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue