From bd43319992d02f8194dce94587de476ee421891b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 27 Feb 2014 23:57:39 +0100 Subject: Bug 801: Graph TextRenderer Cleanup Part-5: *Region API Cleanup (protected impl. part) --- .../classes/com/jogamp/graph/curve/Region.java | 14 +++---------- .../com/jogamp/graph/curve/opengl/GLRegion.java | 23 +++++++++++++--------- 2 files changed, 17 insertions(+), 20 deletions(-) (limited to 'src/jogl/classes/com/jogamp') diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java index 359c63c80..d23de2077 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/Region.java +++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java @@ -110,18 +110,10 @@ public abstract class Region { this.renderModes = regionRenderModes; } - /** - * Returns true, if the implementation uses indices to render the vertices, - * otherwise false. - *

- * Impacts {@link #validateIndices()} and {@link #addOutlineShape(OutlineShape, AffineTransform)} .., - * i.e. defines unique indices if this method returns true. - *

- */ - public abstract boolean usesIndices(); + // FIXME: Better handling of impl. buffer growth .. ! - public abstract void pushVertex(float[] coords, float[] texParams); - public abstract void pushIndex(int idx); + protected abstract void pushVertex(float[] coords, float[] texParams); + protected abstract void pushIndex(int idx); /** * Return bit-field of render modes, see {@link #create(int)}. 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 7bf2ee6e1..6d0e5e538 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -61,18 +61,15 @@ public abstract class GLRegion extends Region { super(renderModes); } - /** Updates a graph region by updating the ogl related - * objects for use in rendering if {@link #isDirty()}. - *

Allocates the ogl related data and initializes it the 1st time.

- *

Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.

- * @param rs TODO + /** + * Updates a graph region by updating the ogl related + * objects for use in rendering if {@link #isDirty()}. + *

Allocates the ogl related data and initializes it the 1st time.

+ *

Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.

*/ protected abstract void update(GL2ES2 gl, RegionRenderer renderer); - /** Delete and clean the associated OGL - * objects - */ - public abstract void destroy(GL2ES2 gl, RegionRenderer renderer); + protected abstract void destroyImpl(GL2ES2 gl, RegionRenderer renderer); protected abstract void clearImpl(final GL2ES2 gl, final RegionRenderer renderer); @@ -84,6 +81,14 @@ public abstract class GLRegion extends Region { clearImpl(); } + /** + * Delete and clear the associated OGL objects. + */ + public final void destroy(GL2ES2 gl, RegionRenderer renderer) { + clear(gl, renderer); + destroyImpl(gl, renderer); + } + /** * Renders the associated OGL objects specifying * current width/hight of window for multi pass rendering -- cgit v1.2.3