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

/tutorial/vision/opengl/NeHe/lesson04/lesson04.e

http://github.com/tybor/Liberty
Specman e | 49 lines | 38 code | 11 blank | 0 comment | 0 complexity | 9a2d2a2191842c9ef49a560d346112dc MD5 | raw file
 1class LESSON04
 2
 3inherit
 4	GRAPHIC
 5	
 6creation
 7	make
 8
 9feature{ANY}
10	
11	world : WORLD
12	triangle : TRIANGLE
13	square : SQUARE
14
15	make is
16		local
17			win: TOPLEVEL_WINDOW
18			exit : BUTTON
19			anim : SIMPLE_PERIODIC_JOB
20		do
21			create win.default_create
22			win.set_title("Lesson 04")
23			win.set_background_color(white_color)
24			win.map
25
26			create world.make(win)
27			create triangle.make_with_position(-1.5, 0.0, -6.0)
28			world.add_opaque_object(triangle)
29			create square.make_with_position(1.5, 0, -6)
30			world.add_opaque_object(square)
31
32			create exit.with_label(win, U"Exit")
33			exit.when_left_clicked(agent finish_program)
34			win.when_close_requested(agent finish_program)
35
36			create anim.set_work(agent triangle.anim(world), Void, 1, 0.01)
37			vision.loop_stack.add_job(anim)
38
39			create anim.set_work(agent square.anim(world), Void, 1, 0.01)
40			vision.loop_stack.add_job(anim)
41
42			vision.start
43		end
44
45	finish_program is
46		do
47			vision.loop_stack.break
48		end
49end