VisClient/org/dronus/gl/GLTextOverlay.java

Go to the documentation of this file.
00001 package org.dronus.gl;
00002 
00003 import java.util.HashSet;
00004 import java.util.LinkedHashSet;
00005 
00006 import org.lwjgl.opengl.GL11;
00007 
00008 public class GLTextOverlay {
00009         
00010         
00011         static GLFont tu=GLFont.getDefault();
00012         
00013         
00014         static HashSet<String> fields=new LinkedHashSet<String>(); 
00015 
00020     static public void print(String text){
00021                 for(String s: text.split("\n"))
00022                         fields.add(s);  
00023     };
00024 
00030     static public void render(){
00031         GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
00032         GLUtil.renderToScreen(.02f,.02f);       
00033         tu.render();
00034         GL11.glScalef(0.035f,0.035f,1);
00035         for (String s: fields){
00036                 GL11.glTranslatef(0.0f, -2f, 0.0f);
00037                 GL11.glPushMatrix();
00038                         tu.print(s);
00039                 GL11.glPopMatrix();
00040         }
00041        GL11.glPopAttrib();
00042         fields.clear();
00043     }
00044     
00049     static public void flush(){
00050         fields.clear();
00051     }
00052 }

Generated on Tue Apr 7 17:57:19 2009 for visclient by  doxygen 1.5.1