Framerate and game loop on mobile

| | August 18, 2015

I’m searching how to manage game framerate on mobiles devices, here is my problem:

On a computer with got something like that:

void main()
{
    while(game.isRunning())
    {
        event.handle(eventInfos);
        game.update(dt);
        graphic.render();
    }
}

On a mobile device with got something like that:

void update()
{
    game.update(dt);
}

void render()
{
    game.render(dt);
}

void event()
{
    game.handle(eventInfos);
}

When I search on internet, I found something like that everytime:

-> GameLoop

-> Fix your time step

I’m using IOS (With GLKViewController) and Android (with the NDK), and I’ve that rendering method is call from another thread

Thanks for your help!

One Response to “Framerate and game loop on mobile”

  1. To get the right amount of movement when using a update(dt) function you must multiply the movement speed against delta time (dt = the amount of time since last frame update). So your position update could look like: newPosition = oldPosition + (moveSpeed * dt)

    I hope this helps, I dont really understand what you mean by ‘manage framerate’.

Leave a Reply