/tutorial/vision/opengl/example4.e
Specman e | 50 lines | 37 code | 13 blank | 0 comment | 0 complexity | 9c5c9e022c832ff8819f6d5a2776d3bc MD5 | raw file
1class EXAMPLE4 2 3inherit 4 GRAPHIC 5 6creation 7 make 8 9feature{ANY} 10 11 world : INTERACTIVE_WORLD 12 pyramid : PYRAMID 13 14 win: FULLSCREEN_WINDOW 15 16 angle : REAL 17 18 make is 19 local 20 anim : SIMPLE_PERIODIC_JOB 21 do 22 create win 23 win.map 24 25 create world.make_interactive(win, agent finish_program) 26 create pyramid.make_with_position(0, 0, -6) 27 world.add_opaque_object(pyramid) 28 29 win.when_close_requested(agent finish_program) 30 31 create anim.set_work(agent turn, Void, 1, 0.01) 32 vision.loop_stack.add_job(anim) 33 34 vision.start 35 end 36 37 turn : BOOLEAN is 38 do 39 angle := angle + 2 40 pyramid.turn(angle, -angle) 41 world.display_gl 42 Result := True 43 end 44 45 finish_program is 46 do 47 vision.loop_stack.break 48 win.destroy 49 end 50end