0

I've tried to use openGL with ndk. Some devices seem to show frames very slowly. I'd like to show frames stably.

If a device is too fast, I can set a limit like this code.

How to limit framerate when using Android's GLSurfaceView.RENDERMODE_CONTINUOUSLY?

On the contrary, If it's too slow, what should I do? I mean, how can I control fps on Android's GLSurfaceView?

Thanks.

Community
  • 1
  • 1
akiniwa
  • 617
  • 8
  • 18

1 Answers1

1

You should make your logic agnostic of the frame rate. For example all your animations should be computed based on a frame_delta_time. This delta_time is computed using the average time it took to render the last frames (or the last one).

Check this: https://gamedev.stackexchange.com/questions/13008/how-to-get-and-use-delta-time

There are some solutions to limit your frame rate, but my advice is to make your logic frame rate agnostics first, then think about limiting the frame rate: How to limit framerate when using Android's GLSurfaceView.RENDERMODE_CONTINUOUSLY?

Community
  • 1
  • 1
Trax
  • 1,890
  • 12
  • 15