/[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.19 by tjl, Thu Sep 19 07:15:20 2002 UTC revision 1.20 by tjl, Mon Sep 23 07:43:42 2002 UTC
# Line 30  for o,a in opts: Line 30  for o,a in opts:
30  def background(rgb):  def background(rgb):
31      return gzz.vob.SolidBgVob(java.awt.Color(float(rgb[0]), float(rgb[1]), float(rgb[2])))      return gzz.vob.SolidBgVob(java.awt.Color(float(rgb[0]), float(rgb[1]), float(rgb[2])))
32    
33    def texbindcode(texid):
34        if texid:
35            return "BindTexture TEXTURE_2D %s"%texid
36        return ""
37    
38  def coloredQuad(rgb):  def coloredQuad(rgb, texid=None):
39        texcode = texbindcode(texid)
40      return getDList("""      return getDList("""
41            PushAttrib TEXTURE_BIT
42            """+texcode+"""
43          Color %s %s %s          Color %s %s %s
44          Begin QUADS          Begin QUADS
45          TexCoord 0 0          TexCoord 0 0
# Line 44  def coloredQuad(rgb): Line 51  def coloredQuad(rgb):
51          TexCoord 1 0          TexCoord 1 0
52          Vertex 1 -1          Vertex 1 -1
53          End          End
54            PopAttrib
55      """%(rgb))      """%(rgb))
56    
57  def quad():  def quad(texid=None):
58        texcode = texbindcode(texid)
59      return getDList("""      return getDList("""
60            PushAttrib TEXTURE_BIT
61            """+texcode+"""
62          Begin QUADS          Begin QUADS
63          TexCoord 0 0          TexCoord 0 0
64          Vertex -1 -1          Vertex -1 -1
# Line 58  def quad(): Line 69  def quad():
69          TexCoord 1 0          TexCoord 1 0
70          Vertex 1 -1          Vertex 1 -1
71          End          End
72            PopAttrib
73      """)      """)
74    
75  def partialquad(x0, y0, x1, y1, texid = None):  def partialquad(x0, y0, x1, y1, texid = None):
76      texcode = ""      texcode = texbindcode(texid)
     if texid:  
         texcode = "BindTexture TEXTURE_2D %s"%texid  
77      return getDList("""      return getDList("""
78          PushAttrib TEXTURE_BIT          PushAttrib TEXTURE_BIT
79          """+texcode+"""          """+texcode+"""

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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