/** * Changes the size of the PlayN window. */ public void setSize(int pixelWidth, int pixelHeight, boolean fullscreen) { setDisplayMode(pixelWidth, pixelHeight, fullscreen); ctx.setSize(pixelWidth, pixelHeight); }
/** * Changes the size of the PlayN window. */ public void setSize(int pixelWidth, int pixelHeight, boolean fullscreen) { setDisplayMode(pixelWidth, pixelHeight, fullscreen); ctx.setSize(pixelWidth, pixelHeight); }
public JavaGraphics(JavaPlatform platform, JavaPlatform.Config config) { this.platform = platform; // if we're being run in headless mode, create a stub GL context which does not trigger the // initialization of LWJGL; this allows tests to run against non-graphics services without // needing to configure LWJGL native libraries this.ctx = config.headless ? new GL20Context(platform, null, config.scaleFactor, false) : new JavaGLContext(platform, config.scaleFactor); this.rootLayer = new GroupLayerGL(ctx); // set up the dummy font contexts Graphics2D aaGfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics(); aaGfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); aaFontContext = aaGfx.getFontRenderContext(); Graphics2D aGfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics(); aGfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); aFontContext = aGfx.getFontRenderContext(); if (!config.headless) { setDisplayMode(ctx.scale.scaledCeil(config.width), ctx.scale.scaledCeil(config.height), config.fullscreen); } }
public JavaGraphics(JavaPlatform platform, JavaPlatform.Config config) { this.platform = platform; // if we're being run in headless mode, create a stub GL context which does not trigger the // initialization of LWJGL; this allows tests to run against non-graphics services without // needing to configure LWJGL native libraries this.ctx = config.headless ? new GL20Context(platform, null, config.scaleFactor, false) : new JavaGLContext(platform, config.scaleFactor); this.rootLayer = new GroupLayerGL(ctx); // set up the dummy font contexts Graphics2D aaGfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics(); aaGfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); aaFontContext = aaGfx.getFontRenderContext(); Graphics2D aGfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics(); aGfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); aFontContext = aGfx.getFontRenderContext(); if (!config.headless) { setDisplayMode(ctx.scale.scaledCeil(config.width), ctx.scale.scaledCeil(config.height), config.fullscreen); } }