I using swing as my game gui with my own look and feel, then I paint swing components to screen directly in every cycle, as below
void gameLoop() {
while(isRunning) {
updateInput();
updateLogic();
renderGameMap();
uiPanel.paint(bufferGraphics);
}
}
And uiPanel.paint(bufferGraphics) drop my fps from 60 to 30? Is there anything wrong? thx