after using the recreateWindow() call in jme1, the window is no longer centered in the monitor.
why not add:
if ( !fs ) {
int x, y;
x = ( Toolkit.getDefaultToolkit().getScreenSize().width - width ) >> 1;
y = ( Toolkit.getDefaultToolkit().getScreenSize().height - height ) >> 1;
Display.setLocation( x, y );
}
to the private void reinitDisplay() Method in the class LWJGLDisplaySystem ? That would be the new code:
private void reinitDisplay() {
// create the Display.
DisplayMode mode = selectMode();
try {
Display.releaseContext();
Display.setDisplayMode( mode );
Display.setFullscreen( fs );
Display.makeCurrent();
if ( !fs ) {
int x, y;
x = ( Toolkit.getDefaultToolkit().getScreenSize().width - width ) >> 1;
y = ( Toolkit.getDefaultToolkit().getScreenSize().height - height ) >> 1;
Display.setLocation( x, y );
}
} catch ( Exception e ) {
logger.logp(Level.SEVERE, this.getClass().toString(), "reinitDisplay()", "Cannot recreate window", e);
throw new Error( "Cannot recreate window: " + e.getMessage() );
}
}