fixed: Windows removed context when exiting from a passive window (thanks to M. Raab...
[opensg.git] / Tools / osgBench / test_nodes.py
blobe74204b37f1f6bfcdce5bd70e4037c742eb4decc
1 # Simple OpenSG benchmark
2 from osgbench import *
4 # Define the Window's parameters
5 win=TestWindow()
6 win.setSize(300,300)
7 win.open()
9 # Create the scene
10 scene=Group()
12 nc=4
14 scene=Group()
16 for i in range(-nc,nc):
17 for j in range(-nc,nc):
18 for k in range(-nc,nc):
19 geo=makeBox(1,1,1, 1,1,1)
20 geo.translate(i*2, j*2, k*2)
21 scene.addChild(geo)
23 # Define the Test(s)
24 test=Test()
25 test.setWindow(win)
26 test.setNFrames(100)
27 test.setScene(scene)
29 test.addFov(90)
30 test.makeOrbit(0,1,0)
32 test.run()
33 fps=test.getFPS()
34 time=test.getTime()
36 # Statistics collection frame
37 test.setStatistics(2)
38 test.setNFrames(2)
39 test.run()
41 print "%d transformed cubes took %f seconds: %f fps" % \
42 (test.getStatValue("NGeometries", 0) , time, fps)