in my game thread i'm trying to get high fps- about 60
but only locking the canvas already make it 60 fps the most
this is the code i use-
public void run()
{
super.run();
int FPS = 60;
final long TPF = 1000 / FPS;
long startTime;
long sleepTime;
while (m_run)
{
startTime = SystemClock.uptimeMillis();
m_canvas = m_surfaceHolder.lockCanvas();
if (m_canvas != null)
{
}
m_surfaceHolder.unlockCanvasAndPost(m_canvas);
sleepTime = TPF - (SystemClock.uptimeMillis() - startTime);
Log.d("sleep", String.valueOf((SystemClock.uptimeMillis() - startTime)));
}
but only by calling lockCanvas
and unlockCanvasAndPost
i get that 60 ms has been over