|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.gui.utils.FpsLabel
public class FpsLabel
Knows how to print a frames per second label (such as 'fps = 120') on
the canvas.
This class uses GLFont2.java, which is a modified version of the
original GLFont2 program written by Brad Fish (in C++). GLFont2.java
is found in the separate glFont2.jar file, and the copyright notice
and terms of use for GLFont2 are in the glFont2.html file that is
found at the same level as the glFont2.jar file. A copy of the
original glfont2.cpp and glfont2.h files are included inside the\
glFont2.jar file, along with a copy of the glFont2.html file with the
copyright and terms of use notice. The glfont.exe executable (for
creating '.glf' files) is also in the jar file (but it will only run
on machines with the windows operating system).
Field Summary | |
---|---|
static String |
FONT_DIRECTORY
Stores the location of the fonts director. |
static String |
FONT_FILE
Stores the name of the fps font file. |
Constructor Summary | |
---|---|
FpsLabel(StructureToGraphics graphics)
Constructs an FpsLabel object. |
Method Summary | |
---|---|
void |
readFontFile(GL gl)
Reads the fpsfont.glf file and stores an OpenGL texture object with the characters to be used for printing frames per second on the canvas during an animation. |
void |
write(GL gl,
GLAutoDrawable canvas,
double fps)
Updates the frames per second display on the canvas. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FONT_DIRECTORY
public static final String FONT_FILE
Constructor Detail |
---|
public FpsLabel(StructureToGraphics graphics)
graphics
- needed for setting a texture and shader.Method Detail |
---|
public void readFontFile(GL gl) throws glFont2.FontReaderException
gl
- the current GL object.
glFont2.FontReaderException
public void write(GL gl, GLAutoDrawable canvas, double fps)
gl
- the current GL object.canvas
- the canvas to draw on.fps
- the number of frames per second.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |