canvas = new AWTGLCanvas(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), new PixelFormat(), sharedDrawable) { private final Dimension minSize = new Dimension(0, 0);
PixelFormat pf = new PixelFormat(settings.getBitsPerPixel(), settings.getAlphaBits(), settings.getDepthBits(), if (created.get() && (pixelFormat.getBitsPerPixel() != pf.getBitsPerPixel() ||pixelFormat.getAlphaBits() != pf.getAlphaBits() ||pixelFormat.getDepthBits() != pf.getDepthBits() ||pixelFormat.getStencilBits() != pf.getStencilBits() ||pixelFormat.getSamples() != pf.getSamples())){ renderer.resetGLObjects(); Display.destroy(); if (pixelFormatChanged && pixelFormat.getSamples() > 1 && GLContext.getCapabilities().GL_ARB_multisample){ GL11.glEnable(ARBMultisample.GL_MULTISAMPLE_ARB);
@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); }
public void init() { if (_inited) { return; } // create the Display. final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(), _settings.getStencilBits()).withSamples(_settings.getSamples()).withStereo(_settings.isStereo()); try { Display.setParent(_canvas); // NOTE: Workaround for possible lwjgl "pixel not accelerated" bug, as suggested by user "faust" try { Display.create(format); } catch (final LWJGLException e) { // failed to create Display, apply workaround (sleep for 1 second) and try again Thread.sleep(1000); Display.create(format); } } catch (final Exception e) { logger.severe("Cannot create window"); logger.logp(Level.SEVERE, this.getClass().toString(), "initDisplay()", "Exception", e); throw new Ardor3dException("Cannot create window: " + e.getMessage()); } _canvasRenderer.init(_settings, true); // true - do swap in renderer. _inited = true; }
public AWTGLCanvas_sceDisplay() throws LWJGLException { super(null, new PixelFormat().withBitsPerPixel(8).withAlphaBits(8).withStencilBits(8).withSamples(antiAliasSamplesNum), null, new ContextAttribs().withDebug(useDebugGL)); }
ContextManager.removeContext(_pbuffer); final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(), _settings.getStencilBits()).withSamples(_settings.getSamples()) .withBitsPerPixel(_settings.getColorDepth()).withStereo(_settings.isStereo()); _pbuffer = new Pbuffer(_width, _height, format, _texture, null); final Object contextKey = _pbuffer;
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; } }
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(); } }); }
@Override public JsonElement serialize(PixelFormat src, Type typeOfSrc, JsonSerializationContext context) { return new JsonPrimitive(src.getDepthBits()); } }
final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(), _settings.getStencilBits()).withSamples(_settings.getSamples()).withStereo(_settings.isStereo());
canvas = new AWTGLCanvas(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), new PixelFormat(), sharedDrawable) { private final Dimension minSize = new Dimension(0, 0);
PixelFormat pf = new PixelFormat(settings.getBitsPerPixel(), 0, settings.getDepthBits(), if (created.get() && (pixelFormat.getBitsPerPixel() != pf.getBitsPerPixel() ||pixelFormat.getDepthBits() != pf.getDepthBits() ||pixelFormat.getStencilBits() != pf.getStencilBits() ||pixelFormat.getSamples() != pf.getSamples())){ renderer.resetGLObjects(); Display.destroy(); if (pixelFormatChanged && pixelFormat.getSamples() > 1 && GLContext.getCapabilities().GL_ARB_multisample){ GL11.glEnable(ARBMultisample.GL_MULTISAMPLE_ARB);
Display.create((new PixelFormat()).withDepthBits(24)); return;
.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();
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.