org.lwjgl.opengl.Display.isCloseRequested()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中org.lwjgl.opengl.Display.isCloseRequested()方法的一些代码示例,展示了Display.isCloseRequested()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Display.isCloseRequested()方法的具体详情如下:
包路径:org.lwjgl.opengl.Display
类名称:Display
方法名:isCloseRequested

Display.isCloseRequested介绍

暂无

代码示例

代码示例来源:origin: MovingBlocks/Terasology

@Override
public boolean isCloseRequested() {
  return Display.isCloseRequested();
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

if (Display.isCloseRequested())
  listener.requestClose(false);

代码示例来源:origin: libgdx/libgdx

public void run () {
  if (!running || Display.isCloseRequested()) {
    running = false;
    stopped();

代码示例来源:origin: libgdx/libgdx

public void run () {
  if (!running || Display.isCloseRequested()) {
    running = false;
    stopped();

代码示例来源:origin: libgdx/libgdx

while (running) {
  Display.processMessages();
  if (Display.isCloseRequested()) exit();

代码示例来源:origin: libgdx/libgdx

while (running) {
  Display.processMessages();
  if (Display.isCloseRequested()) exit();

代码示例来源:origin: com.ardor3d/ardor3d-lwjgl

@MainThread
public boolean isClosing() {
  return Display.isCreated() && Display.isCloseRequested();
}

代码示例来源:origin: MrCrayfish/ModelCreator

int updates = 0;
int frames = 0;
while(!Display.isCloseRequested() && !getCloseRequested())

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

if (Display.isCloseRequested())
  listener.requestClose(false);

代码示例来源:origin: org.slick2d/slick2d-core

/**
 * 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;
    }
  }
}

代码示例来源:origin: org.ode4j/demo

long startTime = System.currentTimeMillis() + 5000;
long fps = 0;
while (run && !Display.isCloseRequested()) {

代码示例来源:origin: playn/playn

@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);
 }
}

代码示例来源:origin: threerings/playn

@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();
}

代码示例来源:origin: com.googlecode.playn/playn-java

@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();
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl

public void run () {
  if (!running || Display.isCloseRequested()) {
    running = false;
    stopped();

代码示例来源:origin: monster860/FastDMM

int height;
while (!Display.isCloseRequested()) {

代码示例来源:origin: DimensionalDevelopment/VanillaFix

private void runGUILoop(GuiScreen screen) throws IOException {
  displayGuiScreen(screen);
  while (running && currentScreen != null && !(currentScreen instanceof GuiMainMenu) && !(Loader.isModLoaded("custommainmenu") && currentScreen instanceof GuiCustom)) {
    if (Display.isCreated() && Display.isCloseRequested()) System.exit(0);
    leftClickCounter = 10000;
    currentScreen.handleInput();

代码示例来源:origin: CallForSanity/Gaalop

startEngine();
while (!Display.isCloseRequested()) {

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl

while (running) {
  Display.processMessages();
  if (Display.isCloseRequested()) exit();

代码示例来源:origin: org.mini2Dx/mini2Dx-desktop

while (running) {
  Display.processMessages();
  if (Display.isCloseRequested()) {
    exit();

相关文章