protected void drawOffscreen( DrawContext dc ) { drawOffscreen( dc.getGLContext( ) ); }
protected void drawOffscreen( DrawContext dc ) { context.makeCurrent( ); try { drawOffscreen( dc.getGLContext( ) ); } finally { dc.getGLContext( ).makeCurrent( ); } }
@Override public void preRender( DrawContext dc ) { if ( tile == null ) { if ( context == null ) { GLContext oldcontext = dc.getGLContext( ); context = dc.getGLDrawable( ).createContext( oldcontext ); } this.offscreenCanvas.initialize( context ); } drawOffscreen( dc ); if ( tile == null ) { int textureHandle = offscreenCanvas.getFrameBuffer( ).getTextureId( ); tile = newTextureSurfaceTile( textureHandle, corners ); } }
@Override public void preRender( DrawContext dc ) { if ( tile == null && offscreenCanvas == null ) { offscreenCanvas = new FBOGlimpseCanvas( dc.getGLContext( ), width, height ); offscreenCanvas.addLayout( background ); } if ( offscreenCanvas.getGLContext( ) != null ) { updateGeometry( dc ); drawOffscreen( dc ); if ( tile == null && corners != null ) { int textureHandle = getTextureHandle( ); tile = newTextureSurfaceTile( textureHandle, corners ); } } }