/** Ends the OpenGL rendering process for the overlay. This is separated out so advanced applications can render independent pieces of the overlay to different portions of the drawable. @throws GLException If an OpenGL context is not current when this method is called */ public void endRendering() throws GLException { renderer.endOrthoRendering(); }
@Override public void display(final GLAutoDrawable drawable) { final GL2 gl = GLContext.getCurrentGL().getGL2(); gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT); if (packer == null) { return; } final TextureRenderer rend = getBackingStore(); final int w = rend.getWidth(); final int h = rend.getHeight(); rend.beginOrthoRendering(w, h); rend.drawOrthoRect(0, 0); rend.endOrthoRendering(); if ((frame.getWidth() != w) || (frame.getHeight() != h)) { EventQueue.invokeLater(new Runnable() { @Override public void run() { frame.setSize(w, h); } }); } }
@Override public void beginMovement(final Object oldBackingStore, final Object newBackingStore) { // Exit the begin / end pair if necessary if (inBeginEndPair) { // Draw any outstanding glyphs flush(); final GL2 gl = GLContext.getCurrentGL().getGL2(); // Pop client attrib bits used by the pipelined quad renderer gl.glPopClientAttrib(); // The OpenGL spec is unclear about whether this changes the // buffer bindings, so preemptively zero out the GL_ARRAY_BUFFER // binding if (getUseVertexArrays() && is15Available(gl)) { try { gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); } catch (final Exception e) { isExtensionAvailable_GL_VERSION_1_5 = false; } } if (isOrthoMode) { ((TextureRenderer) oldBackingStore).endOrthoRendering(); } else { ((TextureRenderer) oldBackingStore).end3DRendering(); } } final TextureRenderer newRenderer = (TextureRenderer) newBackingStore; g = newRenderer.createGraphics(); }
getBackingStore().endOrthoRendering(); } else { getBackingStore().end3DRendering();