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

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

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

Display.isActive介绍

暂无

代码示例

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

protected int getFrameRate () {
  int frameRate = Display.isActive() ? graphics.config.foregroundFPS : graphics.config.backgroundFPS;
  if (frameRate == -1) frameRate = 10;
  if (frameRate == 0) frameRate = graphics.config.backgroundFPS;
  if (frameRate == 0) frameRate = 30;
  return frameRate;
}

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

protected int getFrameRate () {
  int frameRate = Display.isActive() ? graphics.config.foregroundFPS : graphics.config.backgroundFPS;
  if (frameRate == -1) frameRate = 10;
  if (frameRate == 0) frameRate = graphics.config.backgroundFPS;
  if (frameRate == 0) frameRate = 30;
  return frameRate;
}

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

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

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

listener.requestClose(false);
if (wasActive != Display.isActive()) {
  if (!wasActive) {
    listener.gainFocus();

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

if (Display.isCloseRequested()) exit();
boolean isActive = Display.isActive();
if (wasActive && !isActive) { // if it's just recently minimized from active state
  wasActive = false;

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

if (Display.isCloseRequested()) exit();
boolean isActive = Display.isActive();
if (wasActive && !isActive) { // if it's just recently minimized from active state
  wasActive = false;

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

/**
 * @see org.newdawn.slick.GameContainer#hasFocus()
 */
public boolean hasFocus() {
  // hmm, not really the right thing, talk to the LWJGL guys
  return Display.isActive();
}

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

protected int getFrameRate () {
  int frameRate = Display.isActive() ? graphics.config.foregroundFPS : graphics.config.backgroundFPS;
  if (frameRate == -1) frameRate = 10;
  if (frameRate == 0) frameRate = graphics.config.backgroundFPS;
  if (frameRate == 0) frameRate = 30;
  return frameRate;
}

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

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

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

public boolean isActive() {
  return Display.isCreated() && Display.isActive();
}

代码示例来源: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: 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: us.ihmc.thirdparty.jme/jme3-lwjgl

listener.requestClose(false);
if (wasActive != Display.isActive()) {
  if (!wasActive) {
    listener.gainFocus();

代码示例来源: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: 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: org.slick2d/slick2d-core

if (!Display.isActive()) {
  clearControlPressedRecord();
  clearKeyPressedRecord();
  displayActive = Display.isActive();

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

if (Display.isCloseRequested()) exit();
boolean isActive = Display.isActive();
if (wasActive && !isActive) { // if it's just recently minimized from active state
  wasActive = false;

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

boolean isGameActive = Display.isActive();
if (wasActive && !isGameActive) { // if it's just recently minimized

相关文章