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

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

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

Display.setDisplayMode介绍

暂无

代码示例

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

@Override
public boolean setFullscreenMode (DisplayMode displayMode) {
  org.lwjgl.opengl.DisplayMode mode = ((LwjglDisplayMode)displayMode).mode;
  try {
    if (!mode.isFullscreenCapable()) {
      Display.setDisplayMode(mode);
    } else {
      Display.setDisplayModeAndFullscreen(mode);
    }
    float scaleFactor = Display.getPixelScaleFactor();
    config.width = (int)(mode.getWidth() * scaleFactor);
    config.height = (int)(mode.getHeight() * scaleFactor);
    if (Gdx.gl != null) Gdx.gl.glViewport(0, 0, config.width, config.height);
    resize = true;
    return true;
  } catch (LWJGLException e) {
    return false;
  }
}

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

private void updateFullScreenDisplay() throws LWJGLException {
  Display.setDisplayMode(getFullScreenDisplayMode());
  Display.setFullscreen(true);
  Display.setLocation(0, 0);
}

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

@Override
public boolean setFullscreenMode (DisplayMode displayMode) {
  org.lwjgl.opengl.DisplayMode mode = ((LwjglDisplayMode)displayMode).mode;
  try {
    if (!mode.isFullscreenCapable()) {
      Display.setDisplayMode(mode);
    } else {
      Display.setDisplayModeAndFullscreen(mode);
    }
    float scaleFactor = Display.getPixelScaleFactor();
    config.width = (int)(mode.getWidth() * scaleFactor);
    config.height = (int)(mode.getHeight() * scaleFactor);
    if (Gdx.gl != null) Gdx.gl.glViewport(0, 0, config.width, config.height);
    resize = true;
    return true;
  } catch (LWJGLException e) {
    return false;
  }
}

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

case WINDOWED_FULLSCREEN:
  System.setProperty("org.lwjgl.opengl.Window.undecorated", "true");
  Display.setDisplayMode(Display.getDesktopDisplayMode());
  Display.setLocation(0, 0);
  Display.setFullscreen(false);
case WINDOWED:
  System.setProperty("org.lwjgl.opengl.Window.undecorated", "false");
  Display.setDisplayMode(config.getDisplayMode());
  Display.setLocation(config.getWindowPosX(), config.getWindowPosY());
  Display.setFullscreen(false);

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

} else {
  Display.setFullscreen(false);
  Display.setDisplayMode(displayMode);

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

Display.setDisplayMode(targetDisplayMode);
Display.setFullscreen(fullscreen);

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

@Override
public boolean setFullscreenMode (DisplayMode displayMode) {
  org.lwjgl.opengl.DisplayMode mode = ((LwjglDisplayMode)displayMode).mode;
  try {
    if (!mode.isFullscreenCapable()) {
      Display.setDisplayMode(mode);
    } else {
      Display.setDisplayModeAndFullscreen(mode);
    }
    float scaleFactor = Display.getPixelScaleFactor();
    config.width = (int)(mode.getWidth() * scaleFactor);
    config.height = (int)(mode.getHeight() * scaleFactor);
    if (Gdx.gl != null) Gdx.gl.glViewport(0, 0, config.width, config.height);
    resize = true;
    return true;
  } catch (LWJGLException e) {
    return false;
  }
}

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

Display.setDisplayMode(targetDisplayMode);
Display.setFullscreen(fullscreen);

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

Display.setDisplayMode(mode);

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

private void setDebugResolution() {
  org.lwjgl.opengl.DisplayMode mode = new DisplayMode(512, 288);
  try {
    Display.setDisplayMode(mode);
  }
  catch (LWJGLException e) {
    e.printStackTrace();
  }
}

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

Display.setDisplayMode(mode);

代码示例来源:origin: org.lwjgl.lwjgl/lwjgl_util

if ( LWJGLUtil.DEBUG || DEBUG )
    System.out.println("Attempting to set displaymode: " + aDm);
  org.lwjgl.opengl.Display.setDisplayMode(aDm);
  return aDm;
} catch (Exception e) {

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

Display.setDisplayMode(mode);
scale = new Scale(Display.getPixelScaleFactor());

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

Display.setDisplayMode(new DisplayMode(_width, _height));
Display.setTitle("Simulation");
Display.setVSyncEnabled(true);  //for VSync (TZ)

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

} else {
  Display.setFullscreen(false);
  Display.setDisplayMode(displayMode);

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

Display.setDisplayMode(mode);
Display.setFullscreen(_settings.isFullScreen());
Display.create(format);

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

/**
 * Starts the lwjgl engine and shows a window, where the point clouds are rendered
 */
public void startEngine() {
  int width = 800;
  int height = 600;
  
  try {
    Display.setDisplayMode(new DisplayMode(width, height));
    Display.setFullscreen(false);
    Display.setTitle("Gaalop Visualization Window");
    Display.create();
  } catch (LWJGLException e) {
    e.printStackTrace();
    System.exit(0);
  }
  
  GL11.glEnable(GL11.GL_DEPTH_TEST);
  GL11.glShadeModel(GL11.GL_SMOOTH);
  changeSize(width, height);
  GL11.glDisable(GL11.GL_LIGHTING);
  // init OpenGL
  GL11.glViewport(0, 0, width, height);
  GL11.glMatrixMode(GL11.GL_PROJECTION);
  GL11.glLoadIdentity();
  GLU.gluPerspective((float) 65.0, (float) width / (float) height, (float) 0.1, 100);
  GL11.glMatrixMode(GL11.GL_MODELVIEW);
  
  
}

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

this.height = height;
Display.setDisplayMode(targetDisplayMode);
Display.setFullscreen(fullscreen);

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

Display.setDisplayMode(targetDisplayMode);
Display.setFullscreen(fullscreen);

相关文章