当前位置: 首页>>代码示例>>C++>>正文


C++ Pane::PaintAll方法代码示例

本文整理汇总了C++中Pane::PaintAll方法的典型用法代码示例。如果您正苦于以下问题:C++ Pane::PaintAll方法的具体用法?C++ Pane::PaintAll怎么用?C++ Pane::PaintAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pane的用法示例。


在下文中一共展示了Pane::PaintAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PaintAll

////////////////////////////////////////////////////////////////////////////////////////////////////
// PaintAll()
// Paint this panes surface, then paint any children.
// Note: the function ::Paint(), is overloaded by any class derived from Pane.
// Added: pass the clip rect round, as with the others, pass by copy, as this can then be modified
// and passed to child panes.
////////////////////////////////////////////////////////////////////////////////////////////////////
void Pane::PaintAll(	Surface * psurface )
{
	// Clipping test - TBD: reinstate.
/*	if( ( rectClip.XMax() <= rectClip.XMin() ) ||
		( rectClip.YMax() <= rectClip.YMin() ) ||
		( rectClip.XMax() < 0 ) ||
		( rectClip.YMax() < 0 ) )
	{
		return;
	}*/

    if( !m_bHidden )
	{
		Paint( psurface );

        for(Pane* ppane = m_pchild; ppane != NULL; ppane = ppane->m_pnext) 
		{
            WinRect rectClipOld = psurface->GetClipRect();
            psurface->Offset(ppane->m_offset);
            psurface->SetClipRect(WinRect(WinPoint(0, 0), ppane->GetSize()));

 			D3DVIEWPORT9 newViewport, oldViewport;
			CD3DDevice9::Get()->GetViewport( &oldViewport );
			WinRect surfClip = psurface->GetClipRect();
			WinPoint surfOffset = psurface->GetOffset();

			newViewport.X = surfClip.XMin() + surfOffset.X();
			newViewport.Y = surfClip.YMin() + surfOffset.Y();
			newViewport.Width = surfClip.XMax() - surfClip.XMin();
			newViewport.Height = surfClip.YMax() - surfClip.YMin();
			newViewport.MinZ = oldViewport.MinZ;
			newViewport.MaxZ = oldViewport.MaxZ;

			newViewport.X = (int) newViewport.X < 0 ? 0 : newViewport.X;
			newViewport.Y = (int) newViewport.Y < 0 ? 0 : newViewport.Y;
			newViewport.Width = (int) newViewport.Width < 0 ? 0 : newViewport.Width;
			newViewport.Height = (int) newViewport.Height < 0 ? 0 : newViewport.Height;

			if( ( newViewport.Width > 0 ) &&
				( newViewport.Height > 0 ) )
			{
				CD3DDevice9::Get()->SetViewport( &newViewport );			
				ppane->PaintAll( psurface );
			}

			psurface->Offset(-ppane->m_offset);
            psurface->RestoreClipRect(rectClipOld);

			if( ( newViewport.Width > 0 ) &&
				( newViewport.Height > 0 ) )
			{
				CD3DDevice9::Get()->SetViewport( &oldViewport );
			}
       }
        m_bNeedPaint = false;
        m_bPaintAll  = false;
    }
}
开发者ID:AllegianceZone,项目名称:Allegiance,代码行数:65,代码来源:pane.cpp

示例2: PaintAll

void Pane::PaintAll(Surface* psurface)
{
    if (!m_bHidden) {
        Paint(psurface);

        for(Pane* ppane = m_pchild; ppane != NULL; ppane = ppane->m_pnext) {
            WinRect rectClipOld = psurface->GetClipRect();
            psurface->Offset(ppane->m_offset);
            psurface->SetClipRect(WinRect(WinPoint(0, 0), ppane->GetSize()));

            ppane->PaintAll(psurface);

            psurface->Offset(-ppane->m_offset);
            psurface->RestoreClipRect(rectClipOld);
        }

        m_bNeedPaint = false;
        m_bPaintAll  = false;
    }
}
开发者ID:BackTrak,项目名称:Allegiance-R4-Engine,代码行数:20,代码来源:pane.cpp


注:本文中的Pane::PaintAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。