/[gzz]/gzz/gzz/vob/vobs/TextVob.java
ViewVC logotype

Diff of /gzz/gzz/vob/vobs/TextVob.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by benja, Sun Dec 29 02:01:41 2002 UTC revision 1.8 by mudyc, Fri Jan 10 07:36:53 2003 UTC
# Line 55  String rcsid = "$Id$"; Line 55  String rcsid = "$Id$";
55      protected final TextStyle style;      protected final TextStyle style;
56      protected final String text;      protected final String text;
57      protected final boolean baselined;      protected final boolean baselined;
58        protected String textColor = "Color 1 0 0";
59    
60      protected Object key;      protected Object key;
61    
62        /** Same as another constructor but in GL side you can give the color
63         * with string like "Color 1 0.5 0.5"
64         * @param color OpenGL Color used to draw the text.
65         */
66        public TextVob(TextStyle style, String text, boolean baselined, String color) {
67            this(style, text, baselined);
68            this.textColor = color;
69        }
70    
71      /** Create a new TextVob.      /** Create a new TextVob.
72       * @param style The textstyle to use.       * @param style The textstyle to use.
73       * @param text The text that the Vob should show       * @param text The text that the Vob should show
# Line 134  String rcsid = "$Id$"; Line 144  String rcsid = "$Id$";
144          //g.setClip(oldClip);          //g.setClip(oldClip);
145      }      }
146    
147      static private Vob start, stop;      static private Vob start, stop, resetColor;
148        private Vob setColor;
149      static public Vob getStartCode() {      static public Vob getStartCode() {
150          if(start == null) {          if(start == null) {
151              if (GL.hasExtension("GL_NV_register_combiners")) {              if (GL.hasExtension("GL_NV_register_combiners")) {
# Line 168  String rcsid = "$Id$"; Line 179  String rcsid = "$Id$";
179          return stop;          return stop;
180      }      }
181    
182        private Vob setColor() {
183            if(setColor == null) {
184                setColor = GLCache.getCallList(this.textColor);
185            }
186            return setColor;
187        }
188        static public Vob resetColor() {
189            if(resetColor == null) {
190                resetColor = GLCache.getCallList("Color 0 0 0");
191            }
192            return resetColor;
193        }
194    
195        
196    
197    
198      /** The OpenGL renderable for this TextVob.      /** The OpenGL renderable for this TextVob.
199       */       */
# Line 187  String rcsid = "$Id$"; Line 213  String rcsid = "$Id$";
213                      1, 1);                      1, 1);
214          }          }
215          curs = getStartCode().addToListGL(win, list, curs, 0, 0);          curs = getStartCode().addToListGL(win, list, curs, 0, 0);
216            curs = setColor().addToListGL(win, list, curs, 0, 0);
217          curs = ht.addToListGL(win, list, curs, coordsys1, coordsys2);          curs = ht.addToListGL(win, list, curs, coordsys1, coordsys2);
218            curs = resetColor().addToListGL(win, list, curs, 0, 0);
219          curs = getStopCode().addToListGL(win, list, curs, 0, 0);          curs = getStopCode().addToListGL(win, list, curs, 0, 0);
220          return curs;          return curs;
221      }      }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26