/** * Callback. */ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { listener.reshape(width, height); }
/** * Callback. */ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { listener.reshape(width, height); }
@Override public void invoke(final long window, final int width, final int height) { settings.setResolution(width, height); listener.reshape(width, height); } });
@Override public void invoke(final long window, final int width, final int height) { settings.setResolution(width, height); listener.reshape(width, height); } });
@Override public void onSurfaceChanged(GL10 gl, int width, int height) { logger.log(Level.FINE, "GL Surface changed, width: {0} height: {1}", new Object[]{width, height}); // update the application settings with the new resolution settings.setResolution(width, height); // reload settings in androidInput so the correct touch event scaling can be // calculated in case the surface resolution is different than the view androidInput.loadSettings(settings); // if the application has already been initialized (ie renderable is set) // then call reshape so the app can adjust to the new resolution. if (renderable.get()) { logger.log(Level.FINE, "App already initialized, calling reshape"); listener.reshape(width, 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(); }
@Override public void display(GLAutoDrawable glad) { if (!created.get() && renderer != null){ listener.destroy(); logger.fine("Canvas destroyed."); super.internalDestroy(); return; } int newWidth = Math.max(canvas.getWidth(), 1); int newHeight = Math.max(canvas.getHeight(), 1); if (width != newWidth || height != newHeight) { width = newWidth; height = newHeight; if (listener != null) { listener.reshape(width, height); } } boolean flush = autoFlush.get(); if (flush && !wasAnimating){ animator.start(); wasAnimating = true; }else if (!flush && wasAnimating){ animator.stop(); wasAnimating = false; } listener.update(); renderer.postFrame(); }
@Override public void display(GLAutoDrawable glad) { if (!created.get() && renderer != null){ listener.destroy(); logger.fine("Canvas destroyed."); super.internalDestroy(); return; } int newWidth = Math.max(canvas.getWidth(), 1); int newHeight = Math.max(canvas.getHeight(), 1); if (width != newWidth || height != newHeight) { width = newWidth; height = newHeight; if (listener != null) { listener.reshape(width, height); } } boolean flush = autoFlush.get(); if (flush && !wasAnimating){ animator.start(); wasAnimating = true; }else if (!flush && wasAnimating){ animator.stop(); wasAnimating = false; } listener.update(); renderer.postFrame(); }
height = newHeight; if (listener != null){ listener.reshape(width, height);
/** * Callback. */ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { listener.reshape(width, height); }
/** * Callback. */ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { listener.reshape(width, height); }
@Override public void invoke(final long window, final int width, final int height) { settings.setResolution(width, height); listener.reshape(width, 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(); }
@Override public void display(GLAutoDrawable glad) { if (!created.get() && renderer != null){ listener.destroy(); logger.fine("Canvas destroyed."); super.internalDestroy(); return; } int newWidth = Math.max(canvas.getWidth(), 1); int newHeight = Math.max(canvas.getHeight(), 1); if (width != newWidth || height != newHeight) { width = newWidth; height = newHeight; if (listener != null) { listener.reshape(width, height); } } boolean flush = autoFlush.get(); if (flush && !wasAnimating){ animator.start(); wasAnimating = true; }else if (!flush && wasAnimating){ animator.stop(); wasAnimating = false; } listener.update(); renderer.postFrame(); }
@Override public void display(GLAutoDrawable glad) { if (!created.get() && renderer != null){ listener.destroy(); logger.fine("Canvas destroyed."); super.internalDestroy(); return; } int newWidth = Math.max(canvas.getWidth(), 1); int newHeight = Math.max(canvas.getHeight(), 1); if (width != newWidth || height != newHeight) { width = newWidth; height = newHeight; if (listener != null) { listener.reshape(width, height); } } boolean flush = autoFlush.get(); if (flush && !wasAnimating){ animator.start(); wasAnimating = true; }else if (!flush && wasAnimating){ animator.stop(); wasAnimating = false; } listener.update(); renderer.postFrame(); }
height = newHeight; if (listener != null){ listener.reshape(width, height);