本文整理汇总了C++中Viewport::addForeground方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::addForeground方法的具体用法?C++ Viewport::addForeground怎么用?C++ Viewport::addForeground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::addForeground方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCreate
void ViewportBase::onCreate(const Viewport *source)
{
Inherited::onCreate(source);
if(source != NULL)
{
Viewport *pThis = static_cast<Viewport *>(this);
pThis->setCamera(source->getCamera());
pThis->setRoot(source->getRoot());
pThis->setBackground(source->getBackground());
MFUnrecForegroundPtr::const_iterator ForegroundsIt =
source->_mfForegrounds.begin();
MFUnrecForegroundPtr::const_iterator ForegroundsEnd =
source->_mfForegrounds.end ();
while(ForegroundsIt != ForegroundsEnd)
{
pThis->addForeground(*ForegroundsIt);
++ForegroundsIt;
}
pThis->setRenderOptions(source->getRenderOptions());
}
}
示例2: serverRender
void SortLastWindow::serverRender(Window *serverWindow,
UInt32 id,
DrawActionBase *action )
{
Viewport *serverPort = NULL;
Viewport *clientPort = NULL;
UInt32 sv = 0;
UInt32 cv = 0;
UInt32 regionStart = 0;
// duplicate viewports
for(cv = 0, sv = 0; cv < getPort().size(); ++cv)
{
clientPort = getPort()[cv];
if(serverWindow->getPort().size() <= sv)
{
// create new port
serverPort = Viewport::create();
serverWindow->addPort(serverPort);
}
else
{
serverPort = serverWindow->getPort()[sv];
}
// duplicate values
if(getWidth() && getHeight())
{
serverPort->setSize(clientPort->getPixelLeft (),
clientPort->getPixelBottom(),
clientPort->getPixelRight (),
clientPort->getPixelTop ());
}
else
{
serverPort->setSize(0,0,0,0);
}
serverPort->setCamera (clientPort->getCamera ());
serverPort->setRoot (clientPort->getRoot ());
serverPort->setBackground(clientPort->getBackground());
// ignore statistics foreground
serverPort->clearForegrounds();
for(UInt32 f = 0 ; f < serverPort->getForegrounds().size(); ++f)
{
Foreground *fg = clientPort->getForegrounds()[f];
StatisticsForeground *sfg =
dynamic_cast<StatisticsForeground *>(fg);
if(sfg == NULL)
{
serverPort->addForeground(fg);
}
}
serverPort->setTravMask(clientPort->getTravMask());
sv++;
}
// remove unused ports
while(serverWindow->getPort().size() > sv)
{
serverWindow->subPort(sv);
}
// setup visible nodes
setupNodes(id);
// render the viewports
serverWindow->activate();
serverWindow->frameInit();
action->setWindow(serverWindow);
if(getComposer() != NULL)
getComposer()->startFrame();
for(sv = 0; sv < serverWindow->getPort().size(); ++sv)
{
Viewport *vp = serverWindow->getPort()[sv];
Node *root = vp->getRoot();
if(getComposer() != NULL)
getComposer()->startViewport(vp);
// render
vp->render(action);
// compose single viewport
if(getComposer() != NULL)
getComposer()->composeViewport(vp);
}
//.........这里部分代码省略.........