forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

60 FPS limit

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
charnold



Joined: 10 Sep 2005
Posts: 10

PostPosted: Sun May 20, 2007 6:55 am    Post subject: 60 FPS limit Reply with quote

I missing something and can't see it :-( ... I have disabled sceDisplayWaitVblankStart, but still don't get more than 60 fps. (using FW 3.40 OE-A)

That's how the rendering is finished:

Code:

void finishRendering()
{
   sceGuFinish();
   sceGuSync(0,0);
//   sceDisplayWaitVblankStart();
   sceGuSwapBuffers();
}


That are the functions for getting the elapsed time per frame and adding the frames per second:

Code:

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;
}

Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun May 20, 2007 8:01 am    Post subject: Reply with quote

Did you tried to remove "sceGuSync(0,0);" for testing ?
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun May 20, 2007 8:04 am    Post subject: Reply with quote

Make sure you're using sceCtrlPeekBufferPositive and not sceCtrlReadBufferPositive.
Back to top
View user's profile Send private message
charnold



Joined: 10 Sep 2005
Posts: 10

PostPosted: Sun May 20, 2007 9:13 am    Post subject: Reply with quote

Insert_witty_name wrote:
Make sure you're using sceCtrlPeekBufferPositive and not sceCtrlReadBufferPositive.


aah, that was it :-) great thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group