本文整理汇总了C++中Base::DoRender方法的典型用法代码示例。如果您正苦于以下问题:C++ Base::DoRender方法的具体用法?C++ Base::DoRender怎么用?C++ Base::DoRender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base::DoRender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderRecursive
void Base::RenderRecursive(Gwen::Skin::Base* skin, const Gwen::Rect& cliprect)
{
Gwen::Renderer::Base* render = skin->GetRender();
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
render->AddRenderOffset(cliprect);
RenderUnder(skin);
Gwen::Rect rOldRegion = render->ClipRegion();
//
// If this control is clipping, change the clip rect to ourselves
// ( if not then we still clip using our parents clip rect )
//
if (ShouldClip())
{
render->AddClipRegion(cliprect);
if (!render->ClipRegionVisible())
{
render->SetRenderOffset(pOldRenderOffset);
render->SetClipRegion(rOldRegion);
return;
}
}
//
// Render this control and children controls
//
render->StartClip();
{
Render(skin);
if (!Children.empty())
{
// Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if (pChild->Hidden())
continue;
pChild->DoRender(skin);
}
}
}
render->EndClip();
//
// Render overlay/focus
//
{
render->SetClipRegion(rOldRegion);
render->StartClip();
{
RenderOver(skin);
RenderFocus(skin);
}
render->EndClip();
render->SetRenderOffset(pOldRenderOffset);
}
}
示例2: DoRender
void Base::DoRender( Gwen::Skin::Base* skin )
{
// If this control has a different skin,
// then so does its children.
if ( m_Skin )
skin = m_Skin;
// Do think
Think();
Gwen::Renderer::Base* render = skin->GetRender();
if ( render->GetCTT() && ShouldCacheToTexture() )
{
DoCacheRender( skin, this );
return;
}
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
render->AddRenderOffset( GetBounds() );
RenderUnder( skin );
Gwen::Rect rOldRegion = render->ClipRegion();
render->AddClipRegion( GetBounds() );
if ( render->ClipRegionVisible() )
{
render->StartClip();
//Render myself first
Render( skin );
if ( !Children.empty() )
{
//Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if ( pChild->Hidden() ) continue;
pChild->DoRender( skin );
}
}
render->SetClipRegion( rOldRegion );
render->StartClip();
RenderOver( skin );
}
else
{
render->SetClipRegion( rOldRegion );
}
RenderFocus( skin );
render->SetRenderOffset( pOldRenderOffset );
}
示例3: DoCacheRender
void Base::DoCacheRender(Gwen::Skin::Base* skin, Gwen::Controls::Base* pMaster)
{
Gwen::Renderer::Base* render = skin->GetRender();
Gwen::Renderer::ICacheToTexture* cache = render->GetCTT();
if (!cache)
return;
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
Gwen::Rect rOldRegion = render->ClipRegion();
if (this != pMaster)
{
render->AddRenderOffset(GetBounds());
render->AddClipRegion(GetBounds());
}
else
{
render->SetRenderOffset(Gwen::Point(0, 0));
render->SetClipRegion(GetBounds());
}
// See if we need to update the cached texture. Dirty?
if (m_bCacheTextureDirty && render->ClipRegionVisible())
{
render->StartClip();
{
if (IsCachedToTexture())
cache->SetupCacheTexture(this);
// Render myself first
Render(skin);
if (!Children.empty())
{
// Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if (!pChild->Hidden())
{
// Draw child control using normal render. If it is cached it will
// be handled in the same way as this one.
pChild->DoRender(skin);
}
}
}
if (IsCachedToTexture())
{
cache->FinishCacheTexture(this);
m_bCacheTextureDirty = false;
}
}
render->EndClip();
}
// Draw the cached texture.
render->SetClipRegion(rOldRegion);
render->StartClip();
{
render->SetRenderOffset(pOldRenderOffset);
cache->DrawCachedControlTexture(this);
}
render->EndClip();
}