Consecutive JFrames, 2nd isnt accelerated

Hi

Im using Java2D for my game, bufferstrategy on a JFrame which works fine, fps is 100+. Now what I’ve done is create a config window which pops up first allowing various resolutions etc to be selected, and when this window is closed, the settings are saved and only then is the main game window created. However, now the game runs at about 40 fps, as if not accelerated. If i comment out the creation of the config window, the fps is fine. Any pointers as to what I can do so that after the creation and removal of the first window, the second created window is accelerated?

Update: Ok shortly after posting this I realised its because the opengl flag was being set after the creation of the config window, if I move this to before the config window, the 2nd JFrame is accelerated. However, I’d like the config window to be able to select between opengl, direct3d and software. Is there a way I can apply these flags after the creation of the config window and have them behave correctly?

Thanks

Those flags can not be set per frame, they are set per VM.

See this thread for more detail: http://www.java-gaming.org/forums/index.php?topic=14092.0

Keith

You’d need to spawn a new JVM for the settings to take effect.

See:
Runtime.exec(…)