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

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

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

Display.isVisible介绍

暂无

代码示例

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

@Override
public void preShutdown() {
  if (Display.isCreated() && !Display.isFullscreen() && Display.isVisible()) {
    config.setWindowPosX(Display.getX());
    config.setWindowPosY(Display.getY());
  }
}

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

private void checkFocus() {
  // focusLost should be true if it is already true (hasn't been read/cleared yet), or
  // the display is presently not in focus
  _focusLost = _focusLost || !(Display.isActive() && Display.isVisible());
}

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

private void checkFocus() {
  // focusLost should be true if it is already true (hasn't been read/cleared yet), or
  // the display is presently not in focus
  _focusLost = _focusLost || !(Display.isActive() && Display.isVisible());
  //
  // final boolean newFocus =
  //
  // if (!focusLost && newFocus) {
  // // didn't use to have focus, but now we do
  // // do nothing for now, just keep track of the fact that we have focus
  // focusLost = newFocus;
  // } else if (focusLost && !newFocus) {
  // // had focus, but don't anymore - notify the physical input layer
  // physicalLayer.lostFocus();
  // focusLost = newFocus;
  // }
}

代码示例来源: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;
    }
  }
}

相关文章