PDA

View Full Version : How to remove an FPS cap from an android game



Xthira
12-27-2015, 10:11 AM
I have this 3D android game that was made using a modified version of unreal engine 3 and it uses OpenGL. I have access to its source code but I am confused as f*** as to how to go about finding the function that controls the frame-rate. I want to remove the 30 fps cap and ideally cap it to 60 instead. do any of you guys have any idea what kind of things (function names / variable names etc) to look out for when trying to modify the FPS of this type of game. Any ideas would be greatly appreciated.

Dark Photon
12-27-2015, 07:13 PM
eglSwapInterval() (https://www.khronos.org/registry/egl/sdk/docs/man/html/eglSwapInterval.xhtml)

kaufenpreis
01-03-2016, 05:54 AM
public class FPSCounter {
long startTime = System.nanoTime();
int frames = 0;

public void logFrame() {
frames++;
if(System.nanoTime() - startTime >= 1000000000) {
Log.d("FPSCounter", "fps: " + frames);
startTime = System.nanoTime();
}
}

Xthira
01-18-2016, 12:45 PM
I have to thank both of you for your quick responses. They have really enlightened me on this situation.

I looked for a function named "eglsawpinterval" but couldn't find any with those words. However I did manage to find a function called "CFPScounter(void)" and a function called "cfpscounter:;registarframe(long,int,int,int,int)" (not sure If I have spelled it correctly). I didn't see a function called "log frames".

My question now is "have I found the right functions?".