fixed: auto_ptr -> unique_ptr
[opensg.git] / Tools / osgBench / test_poly.py
blob0b0800b70998b025749946c7c576c3c6ccc404a7
1 from osgbench import *
2 t=TestWindow()
3 t.setSize(300,300)
4 t.open()
7 nc=1
8 scene=Group()
9 for i in range(-nc,nc):
10 for j in range(-nc,nc):
11 geo=makePlane(.8,.8,128,128)
12 geo.setDlistCache(1)
13 geo.translate(i*2, j*2, 0)
14 scene.addChild(geo)
16 test=Test()
17 test.setWindow(t)
18 test.setScene(scene)
19 test.setHeadlight(1)
20 test.setNFrames(100)
22 test.clear()
23 test.addFov(90)
24 test.makeOrbit(0,1,0)
26 test.run()
27 fps=test.getFPS()
29 for i in scene.geometries():
30 i.setDlistCache(0)
32 test.run()
33 ncfps=test.getFPS()
35 # Statistics collection frame
36 test.setStatistics(2)
37 test.setNFrames(2)
38 test.run()
40 print " cached: %d tri/frame at %.2f FPS: %.0f tri/sec" % \
41 ( test.getStatValue("NTriangles", 0), fps, \
42 test.getStatValue("NTriangles", 0) * fps )
44 print "noncached: %d tri/frame at %.2f FPS: %.0f tri/sec" % \
45 ( test.getStatValue("NTriangles", 0), ncfps, \
46 test.getStatValue("NTriangles", 0) * ncfps )