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

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

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

Display.getDisplayMode介绍

暂无

代码示例

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

public Object run() {
      try {
        Display.getDisplayMode();
      } catch (Exception e) {
        Log.error(e);
      }
      return null;
    }});
}

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

/**
 * Create a new container wrapping a game
 * 
 * @param game The game to be wrapped
 * @param width The width of the display required
 * @param height The height of the display required
 * @param fullscreen True if we want fullscreen mode
 * @throws SlickException Indicates a failure to initialise the display
 */
public AppGameContainer(Game game,int width,int height,boolean fullscreen) throws SlickException {
  super(game);
  
  originalDisplayMode = Display.getDisplayMode();
  
  setDisplayMode(width,height,fullscreen);
}

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

int width = Display.getDisplayMode().getWidth();
int height = Display.getDisplayMode().getHeight();

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

/**
 * Make a screenshot from the current LWJGL Display
 * Code from pc
 */
public void makeScreenshot() {
  curTime = System.currentTimeMillis();
    ByteBuffer screenBuffer = ByteBuffer.allocateDirect(Display.getDisplayMode().getWidth() * Display.getDisplayMode().getHeight() * 3);
  
  try {
      GL11.glReadBuffer(GL11.GL_BACK);
      GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
      GL11.glReadPixels(0, 0, Display.getDisplayMode().getWidth(),
              Display.getDisplayMode().getHeight(), GL11.GL_RGB,
              GL11.GL_UNSIGNED_BYTE, screenBuffer);
      
      long delay = (lastTime == -1) ? 0: curTime-lastTime;
      lastTime = curTime;
      thread.addFrame(screenBuffer, delay);
      
  } catch (Exception e) {
      System.out.println("Streaming exception.");
      e.printStackTrace();
  }
}

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

protected void init() {
 DisplayMode mode = Display.getDisplayMode();
 ctx.setSize(mode.getWidth(), mode.getHeight());
 ctx.init();
}

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

protected void init() {
 DisplayMode mode = Display.getDisplayMode();
 ctx.setSize(mode.getWidth(), mode.getHeight());
 ctx.init();
}

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

Display.setLocation((Display.getDisplayMode().getWidth() - _width) / 2,
      (Display.getDisplayMode().getHeight() - _height) / 2);
} catch (UnsatisfiedLinkError e) {
  System.err.println("Missing lwjgl native libraries.");

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

log.debug(String.format("Current Display Mode = %s", Display.getDisplayMode()));
  log.debug(String.format("initGL called = %b, OpenGL Version = %s", initGLcalled, openGLversion));
} catch (LWJGLException e) {

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

protected void setDisplayMode(int width, int height, boolean fullscreen) {
 try {
  DisplayMode mode = Display.getDisplayMode();
  if (fullscreen == Display.isFullscreen() &&
    mode.getWidth() == width && mode.getHeight() == height)

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

protected void setDisplayMode(int width, int height, boolean fullscreen) {
 try {
  DisplayMode mode = Display.getDisplayMode();
  if (fullscreen == Display.isFullscreen() &&
    mode.getWidth() == width && mode.getHeight() == height)

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

if (fullscreen) {
  int screenWidth = Display.getDisplayMode().getWidth();
  int screenHeight = Display.getDisplayMode().getHeight();

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

protected void setDisplayMode(int width, int height, boolean fullscreen) {
 try {
  DisplayMode mode = Display.getDisplayMode();
  if (fullscreen == Display.isFullscreen() &&
    mode.getWidth() == width && mode.getHeight() == height) return;

相关文章