@Override public PixelFormat deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (json.isJsonPrimitive() && json.getAsJsonPrimitive().isNumber()) { return new PixelFormat().withDepthBits(json.getAsInt()); } return new PixelFormat().withDepthBits(24); }
canvas = new AWTGLCanvas(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), new PixelFormat(), sharedDrawable) { private final Dimension minSize = new Dimension(0, 0);
canvas = new AWTGLCanvas(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), new PixelFormat(), sharedDrawable) { private final Dimension minSize = new Dimension(0, 0);
.withProfileCore(true); try { Display.create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples), context); } catch (Exception e) { } else { Display .create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples)); usingGL30 = false; Display.create(new PixelFormat(0, 16, 8)); if (getDisplayMode().bitsPerPixel == 16) { bufferFormat = new BufferFormat(5, 6, 5, 0, 16, 8, 0, false); Display.create(new PixelFormat()); } catch (Exception ex3) { if (!softwareMode && config.allowSoftwareMode) {
.withProfileCore(true); try { Display.create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples), context); } catch (Exception e) { } else { Display .create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples)); usingGL30 = false; Display.create(new PixelFormat(0, 16, 8)); if (getDisplayMode().bitsPerPixel == 16) { bufferFormat = new BufferFormat(5, 6, 5, 0, 16, 8, 0, false); Display.create(new PixelFormat()); } catch (Exception ex3) { if (!softwareMode && config.allowSoftwareMode) {
pixelFormat = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(),
pbufferFormat = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(), if (canvasFormat == null){ int samples = getNumSamplesToUse(); canvasFormat = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(),
Display.create(new PixelFormat(/*Alpha Bits*/8, /*Depth bits*/ 8, /*Stencil bits*/ 0, /*samples*/8));
pb = new Pbuffer(1, 1, new PixelFormat(0, 0, 0), null); pb.makeCurrent();
PixelFormat pf = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(),
Camera.Parameters cameraParameters = camera.getParameters(); // retrieve the camera parameters previewFormat = cameraParameters.getPreviewFormat(); // retrieve the Previewformat according to your camera PixelFormat pf = new PixelFormat(); // create a PixelFormat object PixelFormat.getPixelFormatInfo(previewFormat, pf); // get through the previewFormat-int the PixelFormat int bpp = pf.bytesPerPixel; // save the BytesPerPixel for this Pixelformat int bpl = bpp*width; // BytesPerLines is just the "BPP * width" of your PreviewFormat/Picture tess.setImage(imagedata, width, height, bpp, bpl); // setImage with imagedata[], width and height of the previewFormat, etc.
PixelFormat pixFmt = new PixelFormat().withStencilBits(8);
PixelFormat pixelFormat = new PixelFormat(); ContextAttribs contextAtrributes = new ContextAttribs(3, 2) .withForwardCompatible(true) .withProfileCore(true); Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT)); Display.setTitle(WINDOW_TITLE); Display.create(pixelFormat, contextAtrributes);
/** * Enable shared OpenGL context. After calling this all containers created * will shared a single parent context * * @throws SlickException Indicates a failure to create the shared drawable */ public static void enableSharedContext() throws SlickException { try { SHARED_DRAWABLE = new Pbuffer(64, 64, new PixelFormat(8, 0, 0), null); } catch (LWJGLException e) { throw new SlickException("Unable to create the pbuffer used for shard context, buffers not supported", e); } }
static int stencilBits = 0; public static void createDisplay() throws LWJGLException { ImageIO.setUseCache(false); //Disable on-disc stream cache should speed up texture pack reloading. PixelFormat format = new PixelFormat().withDepthBits(24); try { //TODO: Figure out how to determine the max bits. Display.create(format.withStencilBits(8)); stencilBits = 8; } catch(LWJGLException e) { Display.create(format); stencilBits = 0; } }
ContextAttribs attribs = new ContextAttribs(3,3) .withForwardCompatible(true) .withProfileCore(true); try { Display.setDisplayMode(new DisplayMode(WIDTH,HEIGHT)); Display.create(new PixelFormat(),attribs); } catch (LWJGLException e) { e.printStackTrace(); }
PixelFormat pixelFormat = new PixelFormat(); ContextAttribs contextAtrributes = new ContextAttribs(3, 2) .withForwardCompatible(true) .withProfileCore(true); try { Display.setDisplayMode(new DisplayMode(320, 240)); Display.setTitle("Version selection"); Display.create(pixelFormat, contextAtrributes); } catch (LWJGLException e) { e.printStackTrace(); System.exit(-1); }
/** * Create the LWJGL display * * @throws Exception Failure to create display */ private void createDisplay() throws Exception { try { // create display with alpha Display.create(new PixelFormat(8,8,GameContainer.stencil ? 8 : 0)); alphaSupport = true; } catch (Exception e) { // if we couldn't get alpha, let us know alphaSupport = false; Display.destroy(); // create display without alpha Display.create(); } }
public AWTGLCanvas_sceDisplay() throws LWJGLException { super(null, new PixelFormat().withBitsPerPixel(8).withAlphaBits(8).withStencilBits(8).withSamples(antiAliasSamplesNum), null, new ContextAttribs().withDebug(useDebugGL)); }
public LwjglAwtCanvas(final DisplaySettings settings, final LwjglCanvasRenderer canvasRenderer) throws LWJGLException { super(new PixelFormat(settings.getColorDepth(), settings.getAlphaBits(), settings.getDepthBits(), settings .getStencilBits(), settings.getSamples()).withStereo(settings.isStereo())); _settings = settings; _canvasRenderer = canvasRenderer; _canvasRenderer.setCanvasCallback(new LwjglCanvasCallback() { @Override public void makeCurrent() throws LWJGLException { LwjglAwtCanvas.this.makeCurrent(); } @Override public void releaseContext() throws LWJGLException { LwjglAwtCanvas.this.releaseContext(); } }); }