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

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

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

Display.wasResized介绍

暂无

代码示例

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

public void update() {
  if (Display.wasResized()) {
    updateViewport();
    // Note that the "old" and "new" values (0 and 1) in the above call aren't actually
    // used: they are only necessary to ensure that the event is fired up correctly.
  }
}

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

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

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

graphics.config.x = Display.getX();
graphics.config.y = Display.getY();
if (graphics.resize || Display.wasResized()
  || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width
  || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {

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

graphics.config.x = Display.getX();
graphics.config.y = Display.getY();
if (graphics.resize || Display.wasResized()
  || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width
  || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {

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

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

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

graphics.config.x = Display.getX();
graphics.config.y = Display.getY();
if (graphics.resize || Display.wasResized()
  || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width
  || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {

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

graphics.config.x = Display.getX();
graphics.config.y = Display.getY();
if (graphics.resize || Display.wasResized()
    || (int) (Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width
    || (int) (Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {

相关文章