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

/tutorial/vision/opengl/NeHe/lesson05/lesson05.e

http://github.com/tybor/Liberty
Specman e | 49 lines | 38 code | 11 blank | 0 comment | 0 complexity | 94dee93808478c82b0a98fc02b1ad999 MD5 | raw file
 1class LESSON05
 2
 3inherit
 4	GRAPHIC
 5	
 6creation
 7	make
 8
 9feature{ANY}
10	
11	world : WORLD
12	pyramid : PYRAMID
13	cube : CUBE
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 05")
23			win.set_background_color(white_color)
24			win.map
25
26			create world.make(win)
27			create pyramid.make_with_position(-1.5, 0.0, -6.0)
28			world.add_opaque_object(pyramid)
29			create cube.make_with_position(1.5, 0, -6)
30			world.add_opaque_object(cube)
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 pyramid.anim(world), Void, 1, 0.01)
37			vision.loop_stack.add_job(anim)
38
39			create anim.set_work(agent cube.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