public Object run() { try { Display.getDisplayMode(); } catch (Exception e) { Log.error(e); } return null; }}); }
/** * 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); }
int width = Display.getDisplayMode().getWidth(); int height = Display.getDisplayMode().getHeight();
/** * 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(); } }
protected void init() { DisplayMode mode = Display.getDisplayMode(); ctx.setSize(mode.getWidth(), mode.getHeight()); ctx.init(); }
protected void init() { DisplayMode mode = Display.getDisplayMode(); ctx.setSize(mode.getWidth(), mode.getHeight()); ctx.init(); }
Display.setLocation((Display.getDisplayMode().getWidth() - _width) / 2, (Display.getDisplayMode().getHeight() - _height) / 2); } catch (UnsatisfiedLinkError e) { System.err.println("Missing lwjgl native libraries.");
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) {
protected void setDisplayMode(int width, int height, boolean fullscreen) { try { DisplayMode mode = Display.getDisplayMode(); if (fullscreen == Display.isFullscreen() && mode.getWidth() == width && mode.getHeight() == height)
protected void setDisplayMode(int width, int height, boolean fullscreen) { try { DisplayMode mode = Display.getDisplayMode(); if (fullscreen == Display.isFullscreen() && mode.getWidth() == width && mode.getHeight() == height)
if (fullscreen) { int screenWidth = Display.getDisplayMode().getWidth(); int screenHeight = Display.getDisplayMode().getHeight();
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;