Well, here is the PostProcessFrame function in scene manager which extends csBaseEventHandler:
void TerraSceneManager::PostProcessFrame()
{
float currentTime = cc->GetVirtualClock()->GetCurrentTicks() * 0.001f;
int iw, ih;
char fpsstr[50] = { 0 };
if(!g3d)
{
g3d = cc->GetGraphics3D();
g = g3d->GetDriver2D();
font = g->GetFontServer()->LoadFont("DejaVuSans", 16);
}
if(!g3d->BeginDraw(CSDRAW_2DGRAPHICS))
return;
if(scene)
{
scene->PostProcessScene();
}
frameTime = currentTime;
fps++;
if(currentTime - lastTime > 1.0f)
{
lastTime = currentTime;
sprintf(fpsstr, "%d", (int)fps);
fps = 0;
}
font->GetDimensions(fpsstr, iw, ih);
g->Write(font, g->GetWidth()-iw, g->GetHeight()-ih,
Color(g, 255, 255, 255, 190),
Color(g, 255, 255, 255, 0), fpsstr);
g->FinishDraw();
}
Which, for example, will call TerraSceneGame's PostProcessScene function:
void TerraSceneGame::PostProcessScene()
{
RenderCrosshair();
RenderHUD();
console->DrawConsole(g);
}
It's odd, because any drawing I do in the game scene's post processing function it isn't erased right away, but if I do it in the scene manager's post processing, it flickers and is constantly being erased. Any ideas? Thanks.