Hello community,
as you can see I’m new here and hope that this is the right place to address my issue
I recently implemented an FPS counter and was curious if the number it shows is correct, because it seems like the frame count is bound to the configured display refresh rate, even though vertical synchronization is disabled in my graphics driver. Is there some kind of limitation inside JOGL that prevents me from seeing the maximum possible number of frames that can be rendered per second or am I doing something wrong?
Here is my code:
//declarations
private long time = -1;
private int frames = 0;
private int framesToShow = 0;
// fps calculation inside the display() method:
frames++;
long currentTime = System.currentTimeMillis();
if((currentTime - time) >= 1000){
time = currentTime;
framesToShow = frames;
frames = 0;
// Neuen Anpasswert fürs TBM setzen
dt = 1 / framesToShow;
}
// other opengl relevant calls and fps display etc.
I’m missing the correct number, because it might be a good performance indicator. If you only see the refresh rate, you don’t know how far you can go or if some performance tuning may be necessary.
Thanks in advance
Br
MrCastle