summaryrefslogtreecommitdiffstats
path: root/src/demos/j2d/TestTextRenderer.java
Commit message (Collapse)AuthorAgeFilesLines
* Added 3D rendering methods to TextureRenderer and TextRenderer on Kenneth Russel2007-01-201-27/+5
| | | | | | | | | | | | request of several people on javagaming.org forums. Refactored existing 2D rendering support in these classes in terms of the new 3D methods. Wrote new TextCube demo illustrating how to render 2D text in 3D using the TextRenderer. Factored out FPS counter rendering into new FPSCounter utility class and updated TestTextRenderer and FlyingText demos. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@201 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* With help from Chris Campbell, fixed incredibly stupid bug on my part Kenneth Russel2007-01-061-1/+1
| | | | | | | | | | | | | | | | where the new Java 2D TextureRenderer was destroying and re-creating the OpenGL texture every frame. This was why the Java 2D Overlay class was so expensive, and why the TextRenderer wasn't as fast as it seemed it should be. Fixed bugs in all of the Java 2D demos which were covered up by this implicit sync, as well as in the TextRenderer class itself where it was missing a key sync operation. Added code to the Texture.updateSubImage() implementation to clip the incoming rectangle to the bounds of the input data and texture, to keep OpenGL from dropping almost-valid updates on the floor. Ran all of the Java 2D integration demos to verify these fixes. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@198 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Removed debugging codeKenneth Russel2007-01-041-69/+1
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@197 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* With extensive help from Phil Race and Chris Campbell from the Java 2D Kenneth Russel2007-01-041-0/+246
team, added a TextRenderer class which enables high-performance rendering of bitmapped Java 2D fonts, with full Unicode support, into arbitrary OpenGL drawables using a simple API. Builds on top of the TextureRenderer class and its associated functionality; added createAlphaOnlyRenderer() and other methods to enable the TextRenderer. Caches rendering results on a string-by-string basis in an OpenGL texture using a fully automatic least-recently-used algorithm for good efficiency when rendering the same string or strings multiple times. Uses a rectangle packing algorithm, currently housed in com.sun.opengl.impl.packrect, for managing the positions of cached strings on a larger OpenGL texture to avoid OpenGL pipeline state changes. Added a TestTextRenderer demo which simply adds a moving text string and frames-per-second counter to the Gears demo; more sophisticated examples to come. (Some commented-out debugging code is being temporarily left in the new demo, to be removed in the next checkin, in order to have it in the version history.) git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@196 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4