So you want to change a member of a class in your desktop launcher from the code in your game. A very easy (but not scalable) way is to override a method of your game class in your launcher. So in your game class you add a method:
public class MyGame extends ApplicationAdapter { ... protected void setForegroundFPS(int value) {} ... }
Then in your desktop launcher you override that method:
public class DesktopLauncher { LwjglApplicationConfiguration config public static void main (String[] arg) { config = new LwjglApplicationConfiguration(); config.width = 1024; config.height = 768; new LwjglApplication(new MyGame() { @override protected void setForegroundFPS(int value) { config.foregroundFPS = value; } }, config); } }
When you find yourself overriding a lot of method this way, then it's better to add an interface instead. See also: https://github.com/libgdx/libgdx/wiki/Interfacing-with-platform-specific-code