virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { switch (event) { case eFE_Initialize: pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, true ); break; case eFE_Update: { ISystem *pSystem = GetISystem(); IRenderer *pRenderer = gEnv->pRenderer; int sysMem = pSystem->GetUsedMemory(); size_t vidMemThisFrame( 0 ); size_t vidMemRecently( 0 ); pRenderer->GetVideoMemoryUsageStats( vidMemThisFrame, vidMemRecently ); int meshMem = 0; pRenderer->EF_Query(EFQ_Alloc_APIMesh, meshMem); ActivateOutput(pActInfo, OUT_SYSMEM, sysMem); // potentially unsafe if we start using >2gb of video memory...? ActivateOutput(pActInfo, OUT_VIDEOMEM_THISFRAME, int(vidMemThisFrame)); ActivateOutput(pActInfo, OUT_VIDEOMEM_RECENTLY, int(vidMemRecently)); ActivateOutput(pActInfo, OUT_MESHMEM, meshMem); } break; } }
void CBitmapUi::DrawFullFrame() { IRenderer* pRenderer = gEnv->pRenderer; assert( pRenderer != NULL ); bool isStandAlone = ( pRenderer->EF_Query( EFQ_RecurseLevel ) <= 0 ); if ( isStandAlone ) { pRenderer->BeginFrame(); } Draw(); if ( isStandAlone ) { pRenderer->EndFrame(); } }