From 2cafc01f08f9ab05748be6eeb82c417de38b31f7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 27 Feb 2014 10:53:06 +0100 Subject: Bug 801: Graph TextRenderer Cleanup Part-3: Region.addOutlineShape(..) Push GL data directly incl. all index validations Region: - Remove redundant methods to make OutlineShape the unique source. - addVertex(..) - addTriangles(..) - Perform all index validations in addOutlineShape(..) - Push OutlineShape's vertex data and it's triangle indices directly to VBO. GLRegion: Add clear(..) method, allowing to clear the region for new data, i.e. OutlineShapes --- .../classes/com/jogamp/graph/curve/opengl/GLRegion.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java') diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index 78c8660fa..7bf2ee6e1 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -27,12 +27,9 @@ */ package com.jogamp.graph.curve.opengl; -import java.util.List; - import javax.media.opengl.GL2ES2; import com.jogamp.opengl.util.PMVMatrix; -import com.jogamp.graph.curve.OutlineShape; import com.jogamp.graph.curve.Region; /** A GLRegion is the OGL binding of one or more OutlineShapes @@ -77,6 +74,16 @@ public abstract class GLRegion extends Region { */ public abstract void destroy(GL2ES2 gl, RegionRenderer renderer); + protected abstract void clearImpl(final GL2ES2 gl, final RegionRenderer renderer); + + /** + * Clears all data, i.e. triangles, vertices etc. + */ + public void clear(final GL2ES2 gl, final RegionRenderer renderer) { + clearImpl(gl, renderer); + clearImpl(); + } + /** * Renders the associated OGL objects specifying * current width/hight of window for multi pass rendering -- cgit v1.2.3