public void setDisplayMode(int width, int height, boolean fullscreen) throws SlickException {
		if ((this.width == width) && (this.height == height) && (isFullscreen() == fullscreen)) {
			return;
		}
		
		try {
			targetDisplayMode = null;
			if (fullscreen) {
				DisplayMode[] modes = Display.getAvailableDisplayModes();
				int freq = 0;
				
				for (int i=0;i<modes.length;i++) {
					DisplayMode current = modes[i];
					
					if ((current.getWidth() == width) && (current.getHeight() == height)) {
						if ((targetDisplayMode == null) || (current.getFrequency() >= freq)) {
							if ((targetDisplayMode == null) || (current.getBitsPerPixel() > targetDisplayMode.getBitsPerPixel())) {
								targetDisplayMode = current;
								freq = targetDisplayMode.getFrequency();
							}
						}

						// if we've found a match for bpp and frequence against the 
						// original display mode then it's probably best to go for this one
						// since it's most likely compatible with the monitor
						if ((current.getBitsPerPixel() == originalDisplayMode.getBitsPerPixel()) &&
						    (current.getFrequency() == originalDisplayMode.getFrequency())) {
							targetDisplayMode = current;
							break;
						}
					}
				}
			} else {
				targetDisplayMode = new DisplayMode(width,height);
			}
			
			if (targetDisplayMode == null) {
				throw new SlickException("Failed to find value mode: "+width+"x"+height+" fs="+fullscreen);
			}
			
			this.width = width;
			this.height = height;

			Display.setDisplayMode(targetDisplayMode);
			Display.setFullscreen(fullscreen);

			if (Display.isCreated()) {
				initGL();
				enterOrtho();
			} 
			
			if (targetDisplayMode.getBitsPerPixel() == 16) {
				InternalTextureLoader.get().set16BitMode();
			}
		} catch (LWJGLException e) {
			throw new SlickException("Unable to setup mode "+width+"x"+height+" fullscreen="+fullscreen, e);
		}
		
		getDelta();
	}
public void setDisplayMode ( int width , int height , boolean fullscreen ) throws SlickException { if ( ( this . width == width ) && ( this . height == height ) && ( isFullscreen ( ) == fullscreen ) ) { return ; } try { targetDisplayMode = null ; if ( fullscreen ) { DisplayMode [ ] modes = Display . getAvailableDisplayModes ( ) ; int freq = 0 ; for ( int i = 0 ; i < modes . length ; i ++ ) { DisplayMode current = modes [ i ] ; if ( ( current . getWidth ( ) == width ) && ( current . getHeight ( ) == height ) ) { if ( ( targetDisplayMode == null ) || ( current . getFrequency ( ) >= freq ) ) { if ( ( targetDisplayMode == null ) || ( current . getBitsPerPixel ( ) > targetDisplayMode . getBitsPerPixel ( ) ) ) { targetDisplayMode = current ; freq = targetDisplayMode . getFrequency ( ) ; } } if ( ( current . getBitsPerPixel ( ) == originalDisplayMode . getBitsPerPixel ( ) ) && ( current . getFrequency ( ) == originalDisplayMode . getFrequency ( ) ) ) { targetDisplayMode = current ; break ; } } } } else { targetDisplayMode = new DisplayMode ( width , height ) ; } if ( targetDisplayMode == null ) { throw new SlickException ( "Failed to find value mode: " + width + "x" + height + " fs=" + fullscreen ) ; } this . width = width ; this . height = height ; Display . setDisplayMode ( targetDisplayMode ) ; Display . setFullscreen ( fullscreen ) ; if ( Display . isCreated ( ) ) { initGL ( ) ; enterOrtho ( ) ; } if ( targetDisplayMode . getBitsPerPixel ( ) == 16 ) { InternalTextureLoader . get ( ) . set16BitMode ( ) ; } } catch ( LWJGLException e ) { throw new SlickException ( "Unable to setup mode " + width + "x" + height + " fullscreen=" + fullscreen , e ) ; } getDelta ( ) ; }
Set the display mode to be used

@param width The width of the display required
@param height The height of the display required
@param fullscreen True if we want fullscreen mode
@throws SlickException Indicates a failure to initialise the display