/[gzz]/gzz/test/gzz/gfx/gl/basicrender.test
ViewVC logotype

Diff of /gzz/test/gzz/gfx/gl/basicrender.test

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

revision 1.1 by tjl, Wed Oct 9 14:38:42 2002 UTC revision 1.2 by tjl, Thu Oct 10 05:10:21 2002 UTC
# Line 2  from gzz.vob import * Line 2  from gzz.vob import *
2  from java.awt import Color  from java.awt import Color
3  from gzz.gfx.gl import GL, GLCache  from gzz.gfx.gl import GL, GLCache
4    
5  w = getGraphicsWindow()  win = getGraphicsWindow()
6    
7  print "GW: ",w  print "GW: ",win
8  bv = GL.createByteVector(10000)  bv = GL.createByteVector(10000)
9    
10  def checkAvgColor(x, y, w, h, color):  def checkAvgColor(x, y, w, h, color):
11      bv.readFromBuffer_ubytes(w, "FRONT", x, y, w, h, "RGB")      # We want to give the window coords differently
12        bounds = win.window.getBounds()
13        y = bounds.height - 1 - y
14        bv.readFromBuffer_ubytes(win.window, "FRONT", x, y, w, h, "RGB")
15      r = 0.0      r = 0.0
16      g = 0.0      g = 0.0
17      b = 0.0      b = 0.0
# Line 29  def checkAvgColor(x, y, w, h, color): Line 32  def checkAvgColor(x, y, w, h, color):
32                    
33    
34  def testBgTriangle():  def testBgTriangle():
35      vs = w.createVobScene()      vs = win.createVobScene()
36      vs.map.put(SolidBgVob(Color.red))      vs.map.put(SolidBgVob(Color.red))
37      vs.map.put(GLCache.getCallList("""      vs.map.put(GLCache.getCallList("""
38          Color 0 1 0          Color 0 1 0
# Line 40  def testBgTriangle(): Line 43  def testBgTriangle():
43          Vertex 200 100          Vertex 200 100
44          End          End
45      """))      """))
46      vs.coords.renderInterp(w, vs.map, None, None, 0, 1, 1)      vs.coords.renderInterp(win, vs.map, None, None, 0, 1, 1)
47      checkAvgColor(10, 10, 2, 2, (255, 0, 0))      checkAvgColor(10, 10, 2, 2, (255, 0, 0))
48      checkAvgColor(10, 10, 2, 2, (255, 0, 255))      checkAvgColor(110, 110, 2, 2, (0, 255, 0))
49    
50    
51    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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