本文整理汇总了C++中osg::GLUTWindowRecPtr::render方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUTWindowRecPtr::render方法的具体用法?C++ GLUTWindowRecPtr::render怎么用?C++ GLUTWindowRecPtr::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::GLUTWindowRecPtr
的用法示例。
在下文中一共展示了GLUTWindowRecPtr::render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display
// redraw the window
void display(void)
{
if(glutGetWindow() == mainwinid)
{
#ifdef OSG_WITH_NVPERFSDK
if(nvDataProvider->nCounters())
{
nvDataProvider->sample();
OSG::Char8 str[40];
for(int i = 0; nvStatElems[i] != NULL; ++i)
{
if(collector != NULL)
{
sprintf(str, "%s: %f", nvStatElems[i]->getDescription().c_str(),
nvDataProvider->value(i));
OSG::StatStringElem *e = dynamic_cast<OSG::StatStringElem*>(
collector->getElem(*nvStatElems[i]));
e->set(str);
}
}
}
if(runExperiment)
{
int nCount;
const char *expCounters[] = {
"2D Bottleneck", "2D SOL",
"IDX Bottleneck", "IDX SOL",
"GEOM Bottleneck", "GEOM SOL",
"ZCULL Bottleneck", "ZCULL SOL",
"TEX Bottleneck", "TEX SOL",
"ROP Bottleneck", "ROP SOL",
"SHD Bottleneck", "SHD SOL",
"FB Bottleneck", "FB SOL",
"GPU Bottleneck", // Needs to be last
NULL };
for(int i = 0; expCounters[i] != NULL; ++i)
{
NVPMAddCounterByName(const_cast<char *>(expCounters[i]));
}
NVPMBeginExperiment(&nCount);
FLOG(("NVPerfKitSDK: Running %d passes\n", nCount));
for(int i = 0; i < nCount; i++)
{
NVPMBeginPass(i);
mgr->redraw();
NVPMEndPass(i);
}
NVPMEndExperiment();
UINT64 value, cycles;
for(int i = 0; expCounters[i] != NULL; ++i)
{
NVPMGetCounterValueByName(const_cast<char *>(expCounters[i]), 0, &value, &cycles);
FLOG(("%s: %lld value, %lld cycles (%.4f%%)\n",
expCounters[i], value, cycles, value * 100. / cycles));
}
char buffer[1000] = "";
NVPMGetGPUBottleneckName(value, buffer);
FLOG(("GPU Bottleneck: '%s'\n", buffer));
for(int i = 0; expCounters[i] != NULL; ++i)
{
//NVPMRemoveCounterByName(expCounters[i]);
}
runExperiment = false;
}
#endif
mgr->redraw();
}
else if(glutGetWindow() == debugwinid)
{
// Use RenderAction to prevent new occlusion culling on debug output
debugwin->render(debugact);
}
}