PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tutorial/vision/opengl/NeHe/lesson06/lesson06.e

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