/[gzz]/gzz/gfx/demo/opengl/glinfo.py
ViewVC logotype

Diff of /gzz/gfx/demo/opengl/glinfo.py

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

revision 1.5 by jvk, Mon Sep 30 14:04:25 2002 UTC revision 1.6 by jvk, Mon Oct 7 10:15:09 2002 UTC
# Line 1  Line 1 
1  from __future__ import nested_scopes  from __future__ import nested_scopes
2    
 font = None  
 fontsize = 40  
 def getText(text, x = 0, y = 0, z = 2, w = 1, h = 1):  
     global font  
     if font == None:  
         font = GL.createFont("gfx/fonts/a010013l.pfb", fontsize)  
   
     return GLRen.createHorizText(font, text, x, y, z,  w,h)  
   
 def putText(vs, cs1, text, color = None, x = 0, y = 0, z = 2, w = 1, h = 1):  
     if color != None:      
         putnoc(vs, getDListNocoords("Color " + js(color)))  
     putnoc(vs, getDListNocoords("""  
         PushAttrib ENABLE_BIT  
         Disable ALPHA_TEST  
         Disable DEPTH_TEST  
         Enable TEXTURE_2D  
         Enable BLEND  
         BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA  
     """))  
   
     t = getText(text, x, y, z, w, h)  
     vs.map.put(t, cs1)  
       
     putnoc(vs, getDListNocoords("""  
         PopAttrib  
     """))  
   
   
3  def parstr(name):  def parstr(name):
4      return name + ": " + js(GL.getGLFloat(name))      return name + ": " + js(GL.getGLFloat(name))
5    
# Line 144  class InfoScene: Line 115  class InfoScene:
115              ]]              ]]
116                                        
117    
118          putText(vs, cs1, vendor, color=(0,0,0), w=.02, h=.02, y = 1)          putText(vs, cs1, vendor, color=(0,0,0), w=.8, h=.8, y = 1)
119          putText(vs, cs1, renderer, color=(0,0,0), w=.02, h=.02, y = 2)          putText(vs, cs1, renderer, color=(0,0,0), w=.8, h=.8, y = 2)
120          putText(vs, cs1, version, color=(0,0,0), w=.02, h=.02, y = 3)          putText(vs, cs1, version, color=(0,0,0), w=.8, h=.8, y = 3)
121    
122          foo = params          foo = params
123          i = 0          i = 0
# Line 156  class InfoScene: Line 127  class InfoScene:
127              for y in range(0, lines):              for y in range(0, lines):
128                  if i >= len(foo): break                  if i >= len(foo): break
129                                    
130                  putText(vs, cs1, foo[i], color=(0,0,0), w=.008, h=.008,                  putText(vs, cs1, foo[i], color=(0,0,0), w=.32, h=.32,
131                          x=x*(1200./40/rows), y=y*.5+4)                          x=x*(1200./40/rows), y=y*.5+4)
132                  i += 1                  i += 1
133    
# Line 170  class InfoScene: Line 141  class InfoScene:
141              for y in range(0, lines):              for y in range(0, lines):
142                  if i >= len(foo): break                  if i >= len(foo): break
143                                    
144                  putText(vs, cs1, foo[i], color=(0,0,0), w=.008, h=.008,                  putText(vs, cs1, foo[i], color=(0,0,0), w=.32, h=.32,
145                          x=x*(1200./40/rows), y=y*.5+14)                          x=x*(1200./40/rows), y=y*.5+14)
146                  i += 1                  i += 1
147    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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