// redraw the window
void display(void)
{
//     std::cout << ">> FRAME START" << std::endl;

    static OSG::Time   tAcc = 0;
    static OSG::UInt32 fc   = 0;

    OSG::Time t0 = OSG::getSystemTime();

    OSG::FrameHandler::the()->frame();

    OSG::commitChangesAndClear();

    mgr->idle();
    mgr->redraw();

    OSG::Time t1 = OSG::getSystemTime();

    tAcc += (t1 - t0);
    fc   += 1;

    if(tAcc >= 1)
    {
        std::cout << "frame count [" << fc
                  << "] fc/tAcc [" << (fc/tAcc)
                  << "] tAcc/fc [" << (1000.f * (tAcc/fc))
                  << "] ms tAcc [" << tAcc << "] s" << std::endl;

        tAcc = 0;
        fc   = 0;
    }

//     std::cout << "<< FRAME END" << std::endl;

//     mgr->getWindow()->registerConstant(GL_MAX_VERTEX_UNIFORM_COMPONENTS  );
//     mgr->getWindow()->registerConstant(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS);

//     OSG::Real32 maxVPUniforms =
//         mgr->getWindow()->getConstantValue(GL_MAX_VERTEX_UNIFORM_COMPONENTS);
//     OSG::Real32 maxFPUniforms =
//         mgr->getWindow()->getConstantValue(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS);

//     std::cout << "GL_MAX_VERTEX_UNIFORM_COMPONENTS [" << maxVPUniforms
//               << "] GL_MAX_FRAGMENT_UNIFORM_COMPONENTS [" << maxFPUniforms
//               << "]" << std::endl;
}
Beispiel #2
0
// redraw the window
void display(void)
{
    g_mgr->idle();
    g_mgr->redraw();
    OSG::Thread::getCurrentChangeList()->clear();
}
Beispiel #3
0
// redraw the window
void display(void)
{
    mgr->idle();
    mgr->redraw();
}