private final void updateLayoutSize() { final Window w = newtChild; if( null != w ) { // use NEWT child's size for min/pref size! final java.awt.Dimension minSize = new java.awt.Dimension(w.getWidth(), w.getHeight()); setMinimumSize(minSize); setPreferredSize(minSize); } }
@Override public void run() { final int cw = comp.getWidth(); final int ch = comp.getHeight(); if( 0 < cw && 0 < ch ) { if( newtChild.getWidth() != cw || newtChild.getHeight() != ch ) { newtChild.setSize(cw, ch); final boolean v = comp.isShowing(); // compute showing-state throughout hierarchy if(v != newtChild.isVisible()) { newtChild.setVisible(v); } } } else if(newtChild.isVisible()) { newtChild.setVisible(false); } }}); }
@Override public void draw( final JCameraReadableSnapshotType s, final Optional<Vector3D> target) { final GL3 g = this.gl; if (g != null) { this.view = s.cameraMakeViewMatrix(); g.glClearDepth(1.0); g.glClearColor(0.0f, 0.0f, 0.2f, 1.0f); g.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT); g.glEnable(GL.GL_DEPTH_TEST); g.glDepthFunc(GL.GL_LEQUAL); g.glDisable(GL.GL_CULL_FACE); this.drawGround(g); this.drawSceneQuads(g); target.ifPresent(pos -> this.drawSceneTarget(g, pos)); } if (this.want_warp.get()) { final Window w = this.window; if (w != null) { w.warpPointer(w.getWidth() / 2, w.getHeight() / 2); this.want_warp.set(false); } } }