mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-04 22:47:44 -04:00

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@2 be3aeb3a-fb24-0410-a615-afba39da0efa
37 lines
612 B
C
37 lines
612 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <sys/time.h>
|
|
#include "gp2x.h"
|
|
|
|
void spend_cycles(int c);
|
|
|
|
int main(void)
|
|
{
|
|
struct timeval tval; // timing
|
|
int thissec = 0, frames_done = 0;
|
|
|
|
gp2x_init();
|
|
|
|
for (;;)
|
|
{
|
|
gettimeofday(&tval, 0);
|
|
|
|
if(thissec != tval.tv_sec)
|
|
{
|
|
thissec = tval.tv_sec;
|
|
|
|
printf("frames_done: %i\n", frames_done);
|
|
frames_done = 0;
|
|
}
|
|
|
|
|
|
//gp2x_video_wait_vsync();
|
|
//usleep(1); // sleeps a minimum of ~20ms
|
|
//gp2x_video_flip(); // can be called ~430000 times/sec
|
|
spend_cycles(1000);
|
|
frames_done++;
|
|
}
|
|
|
|
}
|
|
|