/[gzz]/gzz/gfx/demo/gldemo.py
ViewVC logotype

Diff of /gzz/gfx/demo/gldemo.py

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

revision 1.32 by tjl, Sun Oct 6 17:37:46 2002 UTC revision 1.33 by jvk, Mon Oct 7 10:15:09 2002 UTC
# Line 99  def partialquad(x0, y0, x1, y1, texid = Line 99  def partialquad(x0, y0, x1, y1, texid =
99          PopAttrib          PopAttrib
100      """ % locals())      """ % locals())
101    
102    fontsize = 32
103  def getFont():  def getFont():
104      global font      global font
105      try:      try:
106          a=font          a=font
107      except:      except:
108          font = GL.createFont("gfx/fonts/a010013l.pfb", 32);          font = GL.createFont("gfx/fonts/a010013l.pfb", fontsize);
109      return font      return font
110    
111    def getText(text, x = 0, y = 0, z = 0, w = 1, h = 1):
112        return GLRen.createHorizText(getFont(), text, x, y, z,  w,h)
113    
114    def putText(vs, cs1, text, color = None, x = 0, y = 0, z = 0, w = 1, h = 1):
115        if color != None:    
116            putnoc(vs, getDListNocoords("Color " + js(color)))
117        putnoc(vs, getDListNocoords("""
118            PushAttrib ENABLE_BIT
119            Disable ALPHA_TEST
120            Disable DEPTH_TEST
121            Enable TEXTURE_2D
122            Enable BLEND
123            BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
124        """))
125    
126        t = getText(text, x, y, z, w, h)
127        vs.map.put(t, cs1)
128        
129        putnoc(vs, getDListNocoords("""
130            PopAttrib
131        """))
132    
133    
134  def js(list):  def js(list):
135      return " ".join([str(el) for el in list])      return " ".join([str(el) for el in list])

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

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