That's how the rendering is finished:
Code: Select all
void finishRendering()
{
sceGuFinish();
sceGuSync(0,0);
// sceDisplayWaitVblankStart();
sceGuSwapBuffers();
}
Code: Select all
clock_t frameticks, currentticks, startticks;
float getElapsedTime()
{
currentticks = clock();
frameticks = (currentticks - startticks);
float fElapsedTime = float(frameticks/(float)CLOCKS_PER_SEC);
startticks = currentticks;
return fElapsedTime;
}
int getFramesPerSec(float fElapsedTime)
{
static int fps = 0;
static int frames = 0;
static float time = 0;
frames++;
time += fElapsedTime;
if (time >= 1)
{
fps = frames;
time = 0.0f;
frames = 0;
}
return fps;
}