aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/text
diff options
context:
space:
mode:
authorRami Santina <[email protected]>2011-05-02 19:28:47 +0300
committerRami Santina <[email protected]>2011-05-02 19:28:47 +0300
commit307ba4ea320a91d5731274ed3191bea840d1fe70 (patch)
treeeb385521092a9db150bcb1963b232e8ba5d5efa4 /src/jogl/classes/jogamp/graph/curve/text
parent73ce473d7bf4de653bb23baa318cc8cdcb03e8ce (diff)
Added nonuniform weight impl; misc enhancements/cleanups
Seperate texcoords from shaprness Added NonUniform weight shader impl for region impl only (not text) Refactor p1y --> weight (equiv to nurbs weight) cleanup shader uniforms (rename/remove unneeded) Enhanced blending of text GPURegionNewtDemo01 - added weight W/Q to manipulate weight refactor r2t --> vbaa (matching algorithm name)
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/text')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java5
-rw-r--r--src/jogl/classes/jogamp/graph/curve/text/GlyphString.java23
2 files changed, 14 insertions, 14 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
index 4d1880064..91a7e4246 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
@@ -145,11 +145,10 @@ public class GlyphShape {
}
/** Triangluate the glyph shape
- * @param sharpness sharpness of the curved regions default = 0.5
* @return ArrayList of triangles which define this shape
*/
- public ArrayList<Triangle> triangulate(float sharpness){
- return shape.triangulate(sharpness);
+ public ArrayList<Triangle> triangulate(){
+ return shape.triangulate();
}
/** Get the list of Vertices of this Object
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
index 1faee87ff..a904c2b48 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
@@ -73,18 +73,18 @@ public class GlyphString {
}
/** Creates the Curve based Glyphs from a Font
- * @param pointFactory TODO
+ * @param vertexFactory vertex impl factory {@link Factory}
* @param paths a list of FontPath2D objects that define the outline
* @param affineTransform a global affine transformation applied to the paths.
*/
- public void createfromFontPath(Factory<? extends Vertex> pointFactory, Path2D[] paths, AffineTransform affineTransform) {
+ public void createfromFontPath(Factory<? extends Vertex> vertexFactory, Path2D[] paths, AffineTransform affineTransform) {
final int numGlyps = paths.length;
for (int index=0;index<numGlyps;index++){
if(paths[index] == null){
continue;
}
PathIterator iterator = paths[index].iterator(affineTransform);
- GlyphShape glyphShape = new GlyphShape(pointFactory, iterator);
+ GlyphShape glyphShape = new GlyphShape(vertexFactory, iterator);
if(glyphShape.getNumVertices() < 3) {
continue;
@@ -93,25 +93,26 @@ public class GlyphString {
}
}
- private ArrayList<Triangle> initializeTriangles(float sharpness){
+ private ArrayList<Triangle> initializeTriangles(){
ArrayList<Triangle> triangles = new ArrayList<Triangle>();
for(GlyphShape glyph:glyphs){
- ArrayList<Triangle> tris = glyph.triangulate(sharpness);
+ ArrayList<Triangle> tris = glyph.triangulate();
triangles.addAll(tris);
}
return triangles;
}
-
+
/** Generate a OGL Region to represent this Object.
- * @param context the GLContext which the region is defined by.
- * @param shaprness the curvature sharpness of the object.
- * @param st shader state
+ * @param gl the current gl object
+ * @param rs the current attached RenderState
+ * @param type either {@link com.jogamp.graph.curve.Region#SINGLE_PASS}
+ * or {@link com.jogamp.graph.curve.Region#TWO_PASS}
*/
public void generateRegion(GL2ES2 gl, RenderState rs, int type){
region = RegionFactory.create(rs, type);
region.setFlipped(true);
- ArrayList<Triangle> tris = initializeTriangles(rs.getSharpness().floatValue());
+ ArrayList<Triangle> tris = initializeTriangles();
region.addTriangles(tris);
int numVertices = region.getNumVertices();
@@ -155,7 +156,7 @@ public class GlyphString {
}
/** Destroy the associated OGL objects
- * @param rs TODO
+ * @param rs the current attached RenderState
*/
public void destroy(GL2ES2 gl, RenderState rs){
region.destroy(gl, rs);