fixed trash-texture upon application start.

This commit is contained in:
rachytski 2011-06-15 00:48:55 +03:00 committed by Alex Zolotarev
parent fb52b71310
commit 0a755e1b9b
3 changed files with 18 additions and 5 deletions

View file

@ -103,7 +103,7 @@
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_whitelist.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_blacklist.txt").c_str(),
2 * 1024 * 1024,
1 * 1024 * 1024,
500 * 1024,
fmt,
!yg::gl::g_isBufferObjectsSupported,
@ -143,6 +143,12 @@
frameBuffer->setRenderTarget(renderBuffer);
frameBuffer->onSize(width, height);
drawer->onSize(width, height);
drawer->screen()->beginFrame();
drawer->screen()->clear();
drawer->screen()->endFrame();
}
- (void)drawView

View file

@ -894,6 +894,13 @@ void FrameWork<TModel>::AddRedrawCommandSure()
OGLCHECK(glPopMatrix());
}
else
{
e->drawer()->screen()->beginFrame();
e->drawer()->screen()->clear(m_bgColor);
e->drawer()->screen()->endFrame();
LOG(LINFO, ("no actual target. just clearing"));
}
}
}

View file

@ -49,7 +49,7 @@ namespace yg
makeCurrent();
GLenum target = GL_RENDERBUFFER_OES;
GLenum internalFormat = m_isDepthBuffer ? GL_DEPTH_COMPONENT16_OES : GL_RGBA8_OES;
GLenum internalFormat = m_isDepthBuffer ? GL_DEPTH_COMPONENT24_OES : GL_RGBA8_OES;
/// @TODO: fix for android
#ifndef OMIM_OS_ANDROID
@ -62,7 +62,7 @@ namespace yg
else
#endif
OGLCHECK(glRenderbufferStorageOES(GL_RENDERBUFFER_OES,
m_isDepthBuffer ? GL_DEPTH_COMPONENT16_OES : GL_RGBA8_OES,
internalFormat,
width,
height));
#else
@ -70,7 +70,7 @@ namespace yg
makeCurrent();
GLenum target = GL_RENDERBUFFER_EXT;
GLenum internalFormat = m_isDepthBuffer ? GL_DEPTH_COMPONENT16 : GL_RGBA;
GLenum internalFormat = m_isDepthBuffer ? GL_DEPTH_COMPONENT24 : GL_RGBA8;
if (m_isMultiSampled)
OGLCHECK(glRenderbufferStorageMultisample(target,
@ -80,7 +80,7 @@ namespace yg
height));
else
OGLCHECK(glRenderbufferStorageEXT(target,
m_isDepthBuffer ? GL_DEPTH_COMPONENT16 : GL_RGBA,
internalFormat,
width,
height));