Java Code Examples for org.lwjgl.opengl.Display#getDisplayMode()

The following examples show how to use org.lwjgl.opengl.Display#getDisplayMode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HyperiumMinecraft.java    From Hyperium with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void displayFix(CallbackInfo ci, boolean fullscreen, int displayWidth, int displayHeight)
    throws LWJGLException {
    Display.setFullscreen(false);
    if (fullscreen) {
        if (Settings.WINDOWED_FULLSCREEN) {
            System.setProperty("org.lwjgl.opengl.Window.undecorated", "true");
        } else {
            Display.setFullscreen(true);
            DisplayMode displaymode = Display.getDisplayMode();
            parent.displayWidth = Math.max(1, displaymode.getWidth());
            parent.displayHeight = Math.max(1, displaymode.getHeight());
        }
    } else {
        if (Settings.WINDOWED_FULLSCREEN) {
            System.setProperty("org.lwjgl.opengl.Window.undecorated", "false");
        } else {
            Display.setDisplayMode(new DisplayMode(displayWidth, displayHeight));
        }
    }

    Display.setResizable(false);
    Display.setResizable(true);

    // effectively overwrites the method
    ci.cancel();
}
 
Example 2
Source File: DisplayContainer.java    From opsu-dance with GNU General Public License v3.0 5 votes vote down vote up
public DisplayContainer()
{
	this.overlays = new ArrayList<>();
	this.resolutionChangedListeners = new ArrayList<>();
	this.backButtonListeners = new LinkedList<>();
	drawCursor = true;

	skinservice.addSkinChangedListener(this);

	this.nativeDisplayMode = Display.getDisplayMode();
	targetBackgroundRenderInterval = 41; // ~24 fps
	lastFrame = getTime();
	delta = 1;
	renderDelta = 1;
}
 
Example 3
Source File: AppGameContainer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public Object run() {
    		try {
    			Display.getDisplayMode();
    		} catch (Exception e) {
    			Log.error(e);
    		}
return null;
        }
 
Example 4
Source File: AppGameContainer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * Create a new container wrapping a game
 * 
 * @param game The game to be wrapped
 * @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
 */
public AppGameContainer(Game game,int width,int height,boolean fullscreen) throws SlickException {
	super(game);
	
	originalDisplayMode = Display.getDisplayMode();
	
	setDisplayMode(width,height,fullscreen);
}