21 |
* Written by Benja Fallenstein and Tuomas Lukka |
* Written by Benja Fallenstein and Tuomas Lukka |
22 |
*/ |
*/ |
23 |
package gzz.vob; |
package gzz.vob; |
24 |
import gzz.gfx.gl.GZZGL; |
import gzz.gfx.gl.GLRen; |
25 |
import java.awt.Rectangle; |
import java.awt.Rectangle; |
26 |
import java.awt.Shape; |
import java.awt.Shape; |
27 |
import gzz.client.*; |
import gzz.client.*; |
105 |
|
|
106 |
/** The OpenGL renderable for this TextVob. |
/** The OpenGL renderable for this TextVob. |
107 |
*/ |
*/ |
108 |
private GZZGL.HorizText ht; |
private GLRen.HorizText ht; |
109 |
static Vob cl; // Color callList - XXX Should be removed - |
static Vob cl; // Color callList - XXX Should be removed - |
110 |
// color should come from outside. |
// color should come from outside. |
111 |
public int addToListGL(GraphicsAPI.Window win, |
public int addToListGL(GraphicsAPI.Window win, |
116 |
float sh = 2.0f/style.getHeight(1); |
float sh = 2.0f/style.getHeight(1); |
117 |
float sw = 2.0f/style.getWidth(text, 1); |
float sw = 2.0f/style.getWidth(text, 1); |
118 |
GLTextStyle gls = (GLTextStyle)style; |
GLTextStyle gls = (GLTextStyle)style; |
119 |
ht = GZZGL.createHorizText( |
ht = GLRen.createHorizText( |
120 |
gls.theFont, |
gls.theFont, |
121 |
text, |
text, |
122 |
-1, 0.7f, -1f, |
-1, 0.7f, -1f, |
123 |
sw * gls.fontScale, sh * gls.fontScale); |
sw * gls.fontScale, sh * gls.fontScale); |
124 |
} |
} |
125 |
if(cl == null) { |
if(cl == null) { |
126 |
cl = GZZGL.createCallList("Color 0 0 0 1"); |
cl = GLRen.createCallList("Color 0 0 0 1"); |
127 |
} |
} |
128 |
curs = cl.addToListGL(win, list, curs, coordsys1, 0); |
curs = cl.addToListGL(win, list, curs, coordsys1, 0); |
129 |
curs = ht.addToListGL(win, list, curs, coordsys1, 0); |
curs = ht.addToListGL(win, list, curs, coordsys1, 0); |