public DisplaySettings resizedCopy(final int width, final int height) { return new DisplaySettings(width, height, _colorDepth, _frequency, _alphaBits, _depthBits, _stencilBits, _samples, _fullScreen, _stereo, _shareContext); } }
protected void doDraw(final Scene toDraw) { toDraw.renderUnto(_parentRenderer); }
public int getWidth() { return _canvas.getCanvasRenderer().getCamera().getWidth(); }
@MainThread private void privateInit() { // tell our parent to lay us out so we have the right starting size. getParent().layout(); final Point size = getSize(); setCurrent(); final DisplaySettings settings = new DisplaySettings(Math.max(size.x, 1), Math.max(size.y, 1), 0, 0, _passedGLData.alphaSize, _passedGLData.depthSize, _passedGLData.stencilSize, _passedGLData.samples, false, _passedGLData.stereo); _canvasRenderer.init(settings, false); // false - do not do back buffer swap, swt will do that. _inited = true; }
@MainThread private void privateInit() { // tell our parent to lay us out so we have the right starting size. getParent().layout(); final Rectangle size = getClientArea(); setCurrent(); final DisplaySettings settings = new DisplaySettings(Math.max(size.width, 1), Math.max(size.height, 1), 0, 0, _passedGLData.alphaSize, _passedGLData.depthSize, _passedGLData.stencilSize, _passedGLData.samples, false, _passedGLData.stereo); _canvasRenderer.init(settings, false); // false - do not do back buffer swap, swt will do that. _inited = true; }
public EffectManager(final DisplaySettings settings, final TextureStoreFormat outputformat) { _canvasSettings = settings; _fsqCamera = new Camera(settings.getWidth(), settings.getHeight()); _fsqCamera.setFrustum(-1, 1, -1, 1, 1, -1); _fsqCamera.setProjectionMode(ProjectionMode.Parallel); _fsqCamera.setAxes(Vector3.NEG_UNIT_X, Vector3.UNIT_Y, Vector3.NEG_UNIT_Z); _outputFormat = outputformat; setupDefaultTargets(outputformat); }
public SwtCanvas(final Composite composite, final int style, final GLData glData) { super(composite, style, glData); _passedGLData = getGLData(); setCurrent(); addListener(SWT.Resize, event -> { final Rectangle clientArea = getClientArea(); for (final ICanvasListener l : _listeners) { l.onResize(clientArea.width, clientArea.height); } }); }
public SwtFboCanvas(final Composite composite, final int style, final DisplaySettings settings) { super(composite, style, toGLData(settings)); _settings = settings; addListener(SWT.Resize, event -> { final Rectangle clientArea = getClientArea(); for (final ICanvasListener l : _listeners) { l.onResize(clientArea.width, clientArea.height); } }); }
@Override public void mouseEntered(final Canvas source, final MouseState current, final InteractManager manager) { if (source == null) { return; } final MouseManager mm = source.getMouseManager(); if (mm != null) { _lastEnteredCanvas = source; mm.setCursor(_cursor); } }
public int getHeight() { return _canvas.getCanvasRenderer().getCamera().getHeight(); }
public TextureRenderer createTextureRenderer(final int width, final int height, final int depthBits, final int samples, final Renderer renderer, final ContextCapabilities caps) { return createTextureRenderer(new DisplaySettings(width, height, depthBits, samples), false, renderer, caps); }
protected void doDraw(final Scene toDraw) { toDraw.renderUnto(_parentRenderer); }
@Override public void mouseDeparted(Canvas source, final MouseState current, final InteractManager manager) { if (source == null) { if (_lastEnteredCanvas != null) { source = _lastEnteredCanvas; } else { return; } } final MouseManager mm = source.getMouseManager(); if (mm != null) { mm.setCursor(null); } _lastEnteredCanvas = null; }
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) { FirstPersonControl.this.move(source.getCanvasRenderer().getCamera(), inputStates.getCurrent() .getKeyboardState(), tpf); } };
public TextureRenderer createTextureRenderer(final int width, final int height, final int depthBits, final int samples, final Renderer renderer, final ContextCapabilities caps) { return createTextureRenderer(new DisplaySettings(width, height, depthBits, samples), false, renderer, caps); }
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) { FirstPersonControl.this.move(source.getCanvasRenderer().getCamera(), inputStates.getCurrent() .getKeyboardState(), tpf); } };
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) { final MouseState mouse = inputStates.getCurrent().getMouseState(); if (mouse.getDx() != 0 || mouse.getDy() != 0) { if (!firstPing) { FirstPersonControl.this.rotate(source.getCanvasRenderer().getCamera(), -mouse.getDx(), -mouse.getDy()); } else { firstPing = false; } } } };
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) { final MouseState mouse = inputStates.getCurrent().getMouseState(); if (mouse.getDx() != 0 || mouse.getDy() != 0) { if (!firstPing) { FirstPersonControl.this.rotate(source.getCanvasRenderer().getCamera(), -mouse.getDx(), -mouse.getDy()); } else { firstPing = false; } } } };