Just updated to LWJGL 2.8.4 and noticed that the fps counter wasn't quiet hitting 60fps when using container.setTargetFPS(60) even though it should.
Doing a bit of digging I noticed that the problem is that the Slick2D fps counter is losing time (a few milliseconds every frame) hence causing it to be a little off.
Firstly in the GameContainer.java class the method updateFPS() should be amended as follows
Code:
protected void updateFPS() {
if (getTime() - lastFPS > 1000) {
lastFPS += 1000;
recordedFPS = fps;
fps = 0;
}
fps++;
}
so just the line "lastFPS = getTime();" should be "lastFPS += 1000";
Secondly the lastFPS variable will now need to be initialised with "lastFPS = getTime();" before the Slick game loop beings.
The above change should give proper FPS calculation without loosing time between frames.