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 |
|
|
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 |
|
|
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" + |
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 |
|
|
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; |
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 |
|
|