/[libvob]/libvob/org/nongnu/libvob/vobs/ContinuousLineVob.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/vobs/ContinuousLineVob.java

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

revision 1.8 by mudyc, Mon Aug 25 19:56:51 2003 UTC revision 1.9 by tjl, Wed Sep 10 12:48:43 2003 UTC
# Line 41  public static final String rcsid = "$Id$ Line 41  public static final String rcsid = "$Id$
41      public static boolean dbg = false;      public static boolean dbg = false;
42    
43      static private GL.Texture tex;      static private GL.Texture tex;
     static private boolean needInit = true;  
44      static private void loadTex() {      static private void loadTex() {
45          if (needInit) {          if (tex == null) {
46              String[] texparam = new String[0];              String[] texparam = new String[0];
47              tex = GL.createTexture();              tex = GL.createTexture();
48              //tex.shade_all_levels(256, 256, 0, 1, "ALPHA", "ALPHA", "line", texparam);              //tex.shade_all_levels(256, 256, 0, 1, "ALPHA", "ALPHA", "line", texparam);
49              tex.shade(128, 128, 0, 1, "ALPHA", "ALPHA", "line", texparam);              tex.shade(128, 128, 0, 1, "ALPHA", "ALPHA", "line", texparam);
             needInit = false;  
50          }          }
51      }      }
52    
# Line 106  public static final String rcsid = "$Id$ Line 104  public static final String rcsid = "$Id$
104    
105      // GL implementation      // GL implementation
106      // =================      // =================
107      static float[] tmp_floats = new float[3];  
108        private Vob initVob;
109        private Vob lineVob;
110        private Vob finishVob;
111    
112      public int putGL(VobScene vs, int coordsys1) {      public int putGL(VobScene vs, int coordsys1) {
113            /*
114             * Mudyc's original implementation.
115             * Left in here until he reads this and the corrected implementation and understands
116             * what was wrong.
117          if (needInit) loadTex();          if (needInit) loadTex();
118    
119          vs.map.put(GLCache.getCallList(          vs.map.put(GLCache.getCallList(
# Line 120  public static final String rcsid = "$Id$ Line 126  public static final String rcsid = "$Id$
126          vs.map.put(cl, coordsys1);          vs.map.put(cl, coordsys1);
127          vs.map.put(GLCache.getCallList("PopAttrib"));          vs.map.put(GLCache.getCallList("PopAttrib"));
128          return  0;          return  0;
129            */
130            if (tex == null) loadTex();
131            if(initVob == null) {
132                initVob = GLCache.getCallList(
133                    "PushAttrib ENABLE_BIT \n"+
134                    "Color "+ ColorUtil.colorGLString(color)
135                    );
136                if (dbg) pa("tex:"+tex+", w:"+width+", jS:"+joinStyle+", chain:"+chain+", points"+points);
137                lineVob =
138                    GLRen.createContinuousLine(tex.getTexId(), width, joinStyle, chain, points);
139                finishVob = GLCache.getCallList("PopAttrib");
140            }
141    
142            vs.map.put(initVob);
143            vs.map.put(lineVob, coordsys1);
144            vs.map.put(finishVob);
145            return  0;
146    
147      }      }
148  }  }
149    
150    

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

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