PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tutorial/vision/opengl/example3.e

http://github.com/tybor/Liberty
Specman e | 51 lines | 38 code | 13 blank | 0 comment | 0 complexity | f7a0b17934e40ef4623047dc949e3aa6 MD5 | raw file
 1class EXAMPLE3
 2
 3inherit
 4	GRAPHIC
 5	
 6creation
 7	make
 8
 9feature{ANY}
10
11	world : WORLD
12	pyramid : PYRAMID
13
14	win: TOPLEVEL_WINDOW
15
16	angle : REAL
17	
18	make is
19		local
20			anim : SIMPLE_PERIODIC_JOB
21		do
22			create win.default_create
23			win.set_title("MyLe")
24			win.set_background_color(white_color)
25			win.map
26
27			create world.make(win)
28			create pyramid.make_with_position(0, 0, -6)
29			world.add_opaque_object(pyramid)
30
31			win.when_close_requested(agent finish_program)
32
33			create anim.set_work(agent turn, Void, 1, 0.02)
34			vision.loop_stack.add_job(anim)
35
36			vision.start
37		end
38
39	turn : BOOLEAN is
40		do
41			angle := angle + 3
42			pyramid.turn(angle, -3*angle)
43			world.display_gl
44			Result := True
45		end
46		
47	finish_program is
48		do
49			vision.loop_stack.break
50		end
51end