Display.update(false);
@Override public void postUpdate(GameState currentState, float delta) { Display.update(); if (!displayThreadActions.isEmpty()) { List<Runnable> actions = Lists.newArrayListWithExpectedSize(displayThreadActions.size()); displayThreadActions.drainTo(actions); actions.forEach(Runnable::run); } int frameLimit = context.get(Config.class).getRendering().getFrameLimit(); if (frameLimit > 0) { Display.sync(frameLimit); } currentState.render(); lwjglDisplay.update(); if (lwjglDisplay.isCloseRequested()) { engine.shutdown(); } }
graphics.frameId++; listener.render(); Display.update(false);
graphics.frameId++; listener.render(); Display.update(false);
Display.releaseContext(); Display.makeCurrent(); Display.update();
graphics.frameId++; listener.render(); Display.update(false); } else {
graphics.frameId++; listener.render(); Display.update(false); } else {
/** * The running game loop * * @throws Exception Indicates a failure within the game's loop rather than the framework */ public void runloop() throws Exception { while (running) { int delta = getDelta(); updateAndRender(delta); updateFPS(); Display.update(); } Display.destroy(); } }
Display.update(false);
public void flushFrame(final boolean doSwap) { renderBuckets(); GL11.glFlush(); if (doSwap) { doApplyState(defaultStateList.get(RenderState.StateType.ColorMask)); if (Constants.stats) { StatCollector.startStat(StatType.STAT_DISPLAYSWAP_TIMER); } Display.update(); if (Constants.stats) { StatCollector.endStat(StatType.STAT_DISPLAYSWAP_TIMER); } } if (Constants.stats) { StatCollector.addStat(StatType.STAT_FRAMES, 1); } }
/** * Strategy for overloading game loop context handling * * @throws SlickException Indicates a game failure */ protected void gameLoop() throws SlickException { int delta = getDelta(); if (!Display.isVisible() && updateOnlyOnVisible) { try { Thread.sleep(100); } catch (Exception e) {} } else { try { updateAndRender(delta); } catch (SlickException e) { Log.error(e); running = false; return; } } updateFPS(); Display.update(); if (Display.isCloseRequested()) { if (game.closeRequested()) { running = false; } } }
Display.update(); if (startTime > System.currentTimeMillis()) { fps++;
@Override protected void loop () { boolean wasActive = Display.isActive(); while (!Display.isCloseRequested()) { // notify the app if lose or regain focus (treat said as pause/resume) boolean newActive = Display.isActive(); if (wasActive != newActive) { dispatchEvent(lifecycle, wasActive ? Lifecycle.PAUSE : Lifecycle.RESUME); wasActive = newActive; } ((LWJGLGraphics)graphics()).checkScaleFactor(); // process frame, if we don't need to provide true pausing if (newActive || !config.truePause) processFrame(); Display.update(); // sleep until it's time for the next frame Display.sync(60); } }
@Override public void run(final Game game) { if (!config.headless) { try { Display.create(); } catch (LWJGLException e) { throw new RuntimeException(e); } } init(game); boolean wasActive = Display.isActive(); while (!Display.isCloseRequested()) { // Notify the app if lose or regain focus (treat said as pause/resume). boolean newActive = Display.isActive(); if (wasActive != newActive) { if (wasActive) onPause(); else onResume(); wasActive = newActive; } // Process frame, if we don't need to provide true pausing if (newActive || !config.truePause) processFrame(game); Display.update(); // Sleep until it's time for the next frame. Display.sync(60); } shutdown(); }
@Override public void run(final Game game) { if (!config.headless) { try { Display.create(); } catch (LWJGLException e) { throw new RuntimeException(e); } } init(game); boolean wasActive = Display.isActive(); while (!Display.isCloseRequested()) { // Notify the app if lose or regain focus (treat said as pause/resume). boolean newActive = Display.isActive(); if (wasActive != newActive) { if (wasActive) onPause(); else onResume(); wasActive = newActive; } // Process frame, if we don't need to provide true pausing if (newActive || !config.truePause) processFrame(game); Display.update(); // Sleep until it's time for the next frame. Display.sync(60); } shutdown(); }
private void render(float partialTicks) { Animation.setPartialTicks(partialTicks); TextureManager.processPendingTextures(); Dimension newDim = newCanvasSize.getAndSet(null); if (newDim != null) { width = newDim.width; height = newDim.height; } this.handleKeyboardInput(); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); this.draw(); Display.update(); if(screenshot != null) { if(screenshot.getFile() != null) { Screenshot.getScreenshot(width, height, screenshot.getCallback(), screenshot.getFile()); } else { Screenshot.getScreenshot(width, height, screenshot.getCallback()); } screenshot = null; } }
graphics.frameId++; listener.render(); Display.update(false);
glPopMatrix(); Display.update();
Display.releaseContext(); Display.makeCurrent(); Display.update();
Display.update(); if (recorder != null) { if (changed || firstFrame) {