Add this code to your Core.java class (or GameClient.java). Perhaps the problem is that you are not passing the required DM [] args to your ScreenManager.java class.
private static final DisplayMode modes[] = { //common monitor DMs new DisplayMode(1366,768,32, DisplayMode.REFRESH_RATE_UNKNOWN), //1366x768px w/32-bit depth new DisplayMode(1366,768,24, DisplayMode.REFRESH_RATE_UNKNOWN), // ' w/24-bit depth new DisplayMode(1366,768,16, DisplayMode.REFRESH_RATE_UNKNOWN), // ' w/16-bit depth new DisplayMode(800,600,32, DisplayMode.REFRESH_RATE_UNKNOWN), //800x600px w/32-bit depth new DisplayMode(800,600,24, DisplayMode.REFRESH_RATE_UNKNOWN), // ' w/24-bit depth new DisplayMode(800,600,16, DisplayMode.REFRESH_RATE_UNKNOWN), // ' w/16-bit depth new DisplayMode(640,480,32, DisplayMode.REFRESH_RATE_UNKNOWN), //640x480px w/32-bit depth new DisplayMode(640,480,24, DisplayMode.REFRESH_RATE_UNKNOWN), // ' w/24-bit depth new DisplayMode(640,480,16, DisplayMode.REFRESH_RATE_UNKNOWN), // ' w/16-bit depth };
I assume the error is related to your public void method setFullScreen (DisplayMode dm). In this case, the full syntax for this method is:
/***************************************************************************** * @description: Creates window for program to run in, using appropriate DM * @param DisplayMode dm */ public void setFullScreen(DisplayMode dm){ JFrame f = new JFrame(); f.setUndecorated(true); //no titlebars/scroll bars etc. f.setIgnoreRepaint(true); f.setResizable(false); //user cannot resize window vc.setFullScreenWindow(f); if(dm!=null && vc.isDisplayChangeSupported()){ //if DM is changeable try { vc.setDisplayMode(dm); } catch (Exception e){/*Catch 'em all*/} } f.createBufferStrategy(2); //set # of screen buffers to 2 }//setFullScreen()
Noticed that it was a soft delivery after publication. Aaahh ...