public void update() { if (Display.wasResized()) { updateViewport(); // Note that the "old" and "new" values (0 and 1) in the above call aren't actually // used: they are only necessary to ensure that the event is fired up correctly. } }
@Override public void runLoop(){ // This method is overriden to do restart if (needRestart.getAndSet(false)) { try { createContext(settings); } catch (LWJGLException ex) { logger.log(Level.SEVERE, "Failed to set display settings!", ex); } listener.reshape(settings.getWidth(), settings.getHeight()); logger.fine("Display restarted."); } else if (Display.wasResized()) { int newWidth = Display.getWidth(); int newHeight = Display.getHeight(); settings.setResolution(newWidth, newHeight); listener.reshape(newWidth, newHeight); } super.runLoop(); }
graphics.config.x = Display.getX(); graphics.config.y = Display.getY(); if (graphics.resize || Display.wasResized() || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {
graphics.config.x = Display.getX(); graphics.config.y = Display.getY(); if (graphics.resize || Display.wasResized() || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {
@Override public void runLoop(){ // This method is overriden to do restart if (needRestart.getAndSet(false)) { try { createContext(settings); } catch (LWJGLException ex) { logger.log(Level.SEVERE, "Failed to set display settings!", ex); } listener.reshape(settings.getWidth(), settings.getHeight()); logger.fine("Display restarted."); } else if (Display.wasResized()) { int newWidth = Display.getWidth(); int newHeight = Display.getHeight(); settings.setResolution(newWidth, newHeight); listener.reshape(newWidth, newHeight); } super.runLoop(); }
graphics.config.x = Display.getX(); graphics.config.y = Display.getY(); if (graphics.resize || Display.wasResized() || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {
graphics.config.x = Display.getX(); graphics.config.y = Display.getY(); if (graphics.resize || Display.wasResized() || (int) (Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width || (int) (Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {