/[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.10 by mudyc, Fri Jan 10 10:01:25 2003 UTC revision 1.11 by tjl, Sun Jan 12 11:41:47 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 0 0 0";      protected String textColor = null;
59    
60      protected Object key;      protected Object key;
61    
# Line 81  String rcsid = "$Id$"; Line 81  String rcsid = "$Id$";
81          this.baselined = baselined;          this.baselined = baselined;
82          this.text = text;          this.text = text;
83    
84          if (color != null)          this.textColor = color;
             this.textColor = color;  
85      }      }
86    
87    
# Line 151  String rcsid = "$Id$"; Line 150  String rcsid = "$Id$";
150          //g.setClip(oldClip);          //g.setClip(oldClip);
151      }      }
152    
153      static private Vob start, stop, resetColor;      static private Vob start, stop;
154      private Vob setColor;      private Vob setColor;
155      static public Vob getStartCode() {      static public Vob getStartCode() {
156          if(start == null) {          if(start == null) {
157              if (GL.hasExtension("GL_NV_register_combiners")) {              if (GL.hasExtension("GL_NV_register_combiners")) {
158                  start = GLCache.getCallList(                  start = GLCache.getCallList(
159  "   PushAttrib ENABLE_BIT TEXTURE_BIT  \n"+  "   PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT  \n"+
160  "   Enable REGISTER_COMBINERS_NV                        \n" +  "   Enable REGISTER_COMBINERS_NV                        \n" +
161  "   CombinerParameterNV NUM_GENERAL_COMBINERS_NV 1      \n" +  "   CombinerParameterNV NUM_GENERAL_COMBINERS_NV 1      \n" +
162  "   CombinerParameterNV CONSTANT_COLOR0_NV 0 0 0 0.4    \n" +  "   CombinerParameterNV CONSTANT_COLOR0_NV 0 0 0 0.4    \n" +
# Line 188  String rcsid = "$Id$"; Line 187  String rcsid = "$Id$";
187    
188      private Vob setColor() {      private Vob setColor() {
189          if(setColor == null) {          if(setColor == null) {
190              setColor = GLCache.getCallList(this.textColor);              setColor = GLCache.getCallList(this.textColor == null ? "" : this.textColor);
191          }          }
192          return setColor;          return setColor;
193      }      }
     static public Vob resetColor() {  
         if(resetColor == null) {  
             resetColor = GLCache.getCallList("Color 0 0 0");  
         }  
         return resetColor;  
     }  
194    
195            
196    
# Line 205  String rcsid = "$Id$"; Line 198  String rcsid = "$Id$";
198      /** The OpenGL renderable for this TextVob.      /** The OpenGL renderable for this TextVob.
199       */       */
200      private Vob ht;      private Vob ht;
201      public int addToListGL(GraphicsAPI.RenderingSurface win,      public int putGL(VobScene vs, int coordsys1) {
                            int[] list, int curs, int coordsys1,  
                            int coordsys2) {  
202          if(dbg) pa("Addtolistgl text "+text);          if(dbg) pa("Addtolistgl text "+text);
203          if(ht == null) {          if(ht == null) {
204              GLTextStyle gls = (GLTextStyle)style;              GLTextStyle gls = (GLTextStyle)style;
# Line 219  String rcsid = "$Id$"; Line 210  String rcsid = "$Id$";
210                      0,                      0,
211                      1, 1);                      1, 1);
212          }          }
213          curs = getStartCode().addToListGL(win, list, curs, 0, 0);          vs.map.put(getStartCode());
214          curs = setColor().addToListGL(win, list, curs, 0, 0);          vs.map.put(setColor());
215          curs = ht.addToListGL(win, list, curs, coordsys1, coordsys2);          vs.map.put(ht, coordsys1);
216          curs = resetColor().addToListGL(win, list, curs, 0, 0);          vs.map.put(getStopCode());
217          curs = getStopCode().addToListGL(win, list, curs, 0, 0);          return 0;
         return curs;  
218      }      }
219    
220    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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