aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-02-27 10:53:06 +0100
committerSven Gothel <[email protected]>2014-02-27 10:53:06 +0100
commit2cafc01f08f9ab05748be6eeb82c417de38b31f7 (patch)
tree8fd55b032fa2585f75517287506604ca739bfed9 /src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java
parent073ac5ab63af792d8468d8bf074b982f7c44ef33 (diff)
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
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java
index b54fcd6a6..944050a14 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderUtil.java
@@ -74,7 +74,7 @@ public class TextRenderUtil {
final Font font, final CharSequence str, final int pixelSize) {
final int charCount = str.length();
- final GLRegion region = Region.create(renderModes);
+ final GLRegion region = GLRegion.create(renderModes);
// region.setFlipped(true);
final Font.Metrics metrics = font.getMetrics();
@@ -88,7 +88,6 @@ public class TextRenderUtil {
float y = 0;
float advanceTotal = 0;
- int numVertices = region.getNumVertices();
for(int i=0; i< charCount; i++) {
final char character = str.charAt(i);
@@ -110,33 +109,7 @@ public class TextRenderUtil {
if( null == glyphShape ) {
continue;
}
- // glyphShape.closeLastOutline();
-
- if( false ) {
- region.addOutlineShape(glyphShape, t);
- } else {
- // System.err.println("XXXXX Pre TRI");
- // glyphShape.getVertices();
- final ArrayList<Triangle> trisIn = glyphShape.getTriangles(OutlineShape.VerticesState.QUADRATIC_NURBS);
- final ArrayList<Vertex> gVertices = glyphShape.getVertices();
-
- if( gVertices.size() < 3 ) {
- continue;
- }
- region.addTriangles(trisIn, t, numVertices);
-
- for(int j=0; j<gVertices.size(); j++) {
- final Vertex vert = gVertices.get(j);
- final Vertex svert = t.transform(vert, null);
- svert.setId(numVertices++);
- if(Region.DEBUG_INSTANCE) {
- System.err.println("IN: "+vert);
- System.err.println("EX: "+svert);
- }
- region.addVertex(svert, null);
- }
- }
- assert( numVertices == region.getNumVertices() );
+ region.addOutlineShape(glyphShape, t);
advanceTotal += glyph.getAdvance(pixelSize, true);
}