|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Text Type Rendering Utility Class adding the Font.Glyphs OutlineShape to a GLRegion.
More...
Public Member Functions | |
| TextRegionUtil (final int renderModes) | |
| AABBox | drawString3D (final GL2ES2 gl, final RegionRenderer renderer, final Font font, final CharSequence str, final Vec4f rgbaColor) |
| Render the string in 3D space w.r.t. More... | |
| void | clear (final GL2ES2 gl) |
Clear all cached GLRegions and mapped values. More... | |
| final void | setCacheLimit (final int newLimit) |
| final void | setCacheLimit (final GL2ES2 gl, final int newLimit) |
Sets the cache limit, see setCacheLimit(int) and validates the cache. More... | |
| final int | getCacheLimit () |
| final int | getCacheSize () |
Static Public Member Functions | |
| static AABBox | addStringToRegion (final Region region, final Font font, final AffineTransform transform, final CharSequence str, final Vec4f rgbaColor) |
| Add the string in 3D space w.r.t. More... | |
| static AABBox | addStringToRegion (final Region region, final Font font, final AffineTransform transform, final CharSequence str, final Vec4f rgbaColor, final AffineTransform temp1, final AffineTransform temp2) |
| Add the string in 3D space w.r.t. More... | |
| static AABBox | addStringToRegion (final boolean preGrowRegion, final Region region, final Font font, final AffineTransform transform, final CharSequence str, final Vec4f rgbaColor, final AffineTransform temp1, final AffineTransform temp2) |
| Add the string in 3D space w.r.t. More... | |
| static int[] | countStringRegion (final Font font, final CharSequence str, final int[] vertIndexCount) |
Count required number of vertices and indices adding to given int[2] vertIndexCount array. More... | |
| static AABBox | drawString3D (final GL2ES2 gl, final int renderModes, final RegionRenderer renderer, final Font font, final CharSequence str, final Vec4f rgbaColor) |
Try using drawString3D(GL2ES2, int, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform) to reuse AffineTransform instances. More... | |
| static AABBox | drawString3D (final GL2ES2 gl, final int renderModes, final RegionRenderer renderer, final Font font, final CharSequence str, final Vec4f rgbaColor, final AffineTransform tmp1, final AffineTransform tmp2) |
| Render the string in 3D space w.r.t. More... | |
| static AABBox | drawString3D (final GL2ES2 gl, final GLRegion region, final RegionRenderer renderer, final Font font, final CharSequence str, final Vec4f rgbaColor) |
Try using drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform) to reuse AffineTransform instances. More... | |
| static AABBox | drawString3D (final GL2ES2 gl, final GLRegion region, final RegionRenderer renderer, final Font font, final CharSequence str, final Vec4f rgbaColor, final AffineTransform tmp1, final AffineTransform tmp2) |
| Render the string in 3D space w.r.t. More... | |
Public Attributes | |
| final int | renderModes |
| final AffineTransform | tempT1 = new AffineTransform() |
| final AffineTransform | tempT2 = new AffineTransform() |
Static Public Attributes | |
| static final int | DEFAULT_CACHE_LIMIT = 256 |
Default cache limit, see setCacheLimit(int). More... | |
Text Type Rendering Utility Class adding the Font.Glyphs OutlineShape to a GLRegion.
OutlineShapes are all produced in font em-size [0..1].
Definition at line 50 of file TextRegionUtil.java.
| com.jogamp.graph.curve.opengl.TextRegionUtil.TextRegionUtil | ( | final int | renderModes | ) |
Definition at line 54 of file TextRegionUtil.java.
|
static |
Add the string in 3D space w.r.t.
the font in font em-size [0..1] at the end of the GLRegion while passing the progressed AffineTransform.
The shapes added to the GLRegion are in font em-size [0..1], but can be adjusted with the given transform, progressed and passed to the visitor.
Origin of rendered text is 0/0 at bottom left.
Depending on preGrowRegion, the region buffer's size is grown by pre-calculating required size via countStringRegion(Font, CharSequence, int[]).
| preGrowRegion | if true, utilizes countStringRegion(Font, CharSequence, int[]) to pre-calc required buffer size, otherwise not. |
| region | the GLRegion sink |
| font | the target Font |
| transform | optional given transform |
| str | string text |
| rgbaColor | if Region#hasColorChannel() RGBA color must be passed, otherwise value is ignored. |
| temp1 | temporary AffineTransform storage, mandatory |
| temp2 | temporary AffineTransform storage, mandatory |
Definition at line 131 of file TextRegionUtil.java.
|
static |
Add the string in 3D space w.r.t.
the font in font em-size [0..1] at the end of the GLRegion while passing the progressed AffineTransform.
The shapes added to the GLRegion are in font em-size [0..1], but can be adjusted with the given transform, progressed and passed to the visitor.
Origin of rendered text is 0/0 at bottom left.
The region buffer's size is grown by pre-calculating required size via countStringRegion(Font, CharSequence, int[]).
| region | the GLRegion sink |
| font | the target Font |
| transform | optional given transform |
| str | string text |
| rgbaColor | if Region#hasColorChannel() RGBA color must be passed, otherwise value is ignored. |
Definition at line 77 of file TextRegionUtil.java.
|
static |
Add the string in 3D space w.r.t.
the font in font em-size [0..1] at the end of the GLRegion while passing the progressed AffineTransform.
The shapes added to the GLRegion are in font em-size [0..1], but can be adjusted with the given transform, progressed and passed to the visitor.
Origin of rendered text is 0/0 at bottom left.
The region buffer's size is grown by pre-calculating required size via countStringRegion(Font, CharSequence, int[]).
| region | the GLRegion sink |
| font | the target Font |
| transform | optional given transform |
| str | string text |
| rgbaColor | if Region#hasColorChannel() RGBA color must be passed, otherwise value is ignored. |
| temp1 | temporary AffineTransform storage, mandatory |
| temp2 | temporary AffineTransform storage, mandatory |
Definition at line 103 of file TextRegionUtil.java.
| void com.jogamp.graph.curve.opengl.TextRegionUtil.clear | ( | final GL2ES2 | gl | ) |
Clear all cached GLRegions and mapped values.
Definition at line 343 of file TextRegionUtil.java.
|
static |
Count required number of vertices and indices adding to given int[2] vertIndexCount array.
The region's buffer can be either set using Region#setBufferCapacity(int, int) or grown using Region#growBuffer(int, int).
| font | the target Font |
| str | string text |
| vertIndexCount | the int[2] storage where the counted vertices and indices are added, vertices at [0] and indices at [1] |
Definition at line 162 of file TextRegionUtil.java.
|
static |
Try using drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform) to reuse AffineTransform instances.
The region buffer's size is grown by pre-calculating required size via countStringRegion(Font, CharSequence, int[]).
Definition at line 290 of file TextRegionUtil.java.
|
static |
Render the string in 3D space w.r.t.
the font in font em-size [0..1] at the end of the given GLRegion.
User might want to GLRegion#clear(GL2ES2) the region before calling this method.
The shapes added to the GLRegion are in font em-size [0..1].
Origin of rendered text is 0/0 at bottom left.
The region buffer's size is grown by pre-calculating required size via countStringRegion(Font, CharSequence, int[]).
| gl | the current GL state |
| region | |
| renderer | |
| font | Font to be used |
| str | text to be rendered |
| rgbaColor | used to fill the region's color-channel if used and set renderer's static-color to white. Otherwise used to set the renderer's static-color only, if not null. |
| tmp1 | temp AffineTransform to be reused |
| tmp2 | temp AffineTransform to be reused |
| Exception | if TextRenderer not initialized |
Definition at line 322 of file TextRegionUtil.java.
|
static |
Try using drawString3D(GL2ES2, int, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform) to reuse AffineTransform instances.
The region's buffer size is pre-calculated via GLRegion#create(com.jogamp.opengl.GLProfile, int, com.jogamp.opengl.util.texture.TextureSequence, Font, CharSequence)
Definition at line 230 of file TextRegionUtil.java.
|
static |
Render the string in 3D space w.r.t.
the font in font em-size [0..1] at the end of an internally temporary GLRegion.
The shapes added to the GLRegion are in font em-size [0..1].
Origin of rendered text is 0/0 at bottom left.
The region's buffer size is pre-calculated via GLRegion#create(com.jogamp.opengl.GLProfile, int, com.jogamp.opengl.util.texture.TextureSequence, Font, CharSequence)
In case of a multisampling region renderer, i.e. Region#VBAA_RENDERING_BIT, recreating the GLRegion is a huge performance impact. In such case better use drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, CharSequence, Vec4f, AffineTransform, AffineTransform) instead.
| gl | the current GL state |
| renderModes | TODO |
| font | Font to be used |
| str | text to be rendered |
| rgbaColor | used to fill the region's color-channel if used and set renderer's static-color to white. Otherwise used to set the renderer's static-color only, if not null. |
| tmp1 | temp AffineTransform to be reused |
| tmp2 | temp AffineTransform to be reused |
| Exception | if TextRenderer not initialized |
Definition at line 264 of file TextRegionUtil.java.
| AABBox com.jogamp.graph.curve.opengl.TextRegionUtil.drawString3D | ( | final GL2ES2 | gl, |
| final RegionRenderer | renderer, | ||
| final Font | font, | ||
| final CharSequence | str, | ||
| final Vec4f | rgbaColor | ||
| ) |
Render the string in 3D space w.r.t.
the font int font em-size [0..1] at the end of an internally cached GLRegion.
The shapes added to the GLRegion are in font em-size [0..1].
Origin of rendered text is 0/0 at bottom left.
Cached GLRegions will be destroyed w/ clear(GL2ES2) or to free memory.
The region's buffer size is pre-calculated via GLRegion#create(com.jogamp.opengl.GLProfile, int, com.jogamp.opengl.util.texture.TextureSequence, Font, CharSequence)
| gl | the current GL state |
| renderer | TODO |
| font | Font to be used |
| str | text to be rendered |
| rgbaColor | used to fill the region's color-channel if used and set renderer's static-color to white. Otherwise used to set the renderer's static-color only, if not null. |
| Exception | if TextRenderer not initialized |
Definition at line 198 of file TextRegionUtil.java.
| final int com.jogamp.graph.curve.opengl.TextRegionUtil.getCacheLimit | ( | ) |
Definition at line 379 of file TextRegionUtil.java.
| final int com.jogamp.graph.curve.opengl.TextRegionUtil.getCacheSize | ( | ) |
getCacheLimit() Definition at line 384 of file TextRegionUtil.java.
| final void com.jogamp.graph.curve.opengl.TextRegionUtil.setCacheLimit | ( | final GL2ES2 | gl, |
| final int | newLimit | ||
| ) |
Sets the cache limit, see setCacheLimit(int) and validates the cache.
| gl | current GL used to remove cached objects if required |
| newLimit | new cache size |
Definition at line 374 of file TextRegionUtil.java.
| final void com.jogamp.graph.curve.opengl.TextRegionUtil.setCacheLimit | ( | final int | newLimit | ) |
Sets the cache limit for reusing GlyphString's and their Region. Default is DEFAULT_CACHE_LIMIT, -1 unlimited, 0 turns cache off, >0 limited
The cache will be validate when the next string rendering happens.
| newLimit | new cache size |
Definition at line 364 of file TextRegionUtil.java.
|
static |
Default cache limit, see setCacheLimit(int).
Definition at line 458 of file TextRegionUtil.java.
| final int com.jogamp.graph.curve.opengl.TextRegionUtil.renderModes |
Definition at line 52 of file TextRegionUtil.java.
| final AffineTransform com.jogamp.graph.curve.opengl.TextRegionUtil.tempT1 = new AffineTransform() |
Definition at line 460 of file TextRegionUtil.java.
| final AffineTransform com.jogamp.graph.curve.opengl.TextRegionUtil.tempT2 = new AffineTransform() |
Definition at line 461 of file TextRegionUtil.java.