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

/tutorial/vision/opengl/example1.e

http://github.com/tybor/Liberty
Specman e | 50 lines | 38 code | 12 blank | 0 comment | 0 complexity | 8c09329cc83148ccaf43de920fd9063a MD5 | raw file
 1class EXAMPLE1
 2
 3inherit
 4	GRAPHIC
 5	
 6creation
 7	make
 8
 9feature{ANY}
10	
11	world : WORLD
12	pyramid : PYRAMID
13
14	rot : REAL
15
16	make is
17		local
18			win: TOPLEVEL_WINDOW
19			exit : BUTTON
20		do
21			create win.default_create
22			win.set_title("GL Test")
23			win.set_background_color(white_color)
24			win.map
25
26			create world.make(win)
27			create pyramid.make_with_position(0, 0, -6)
28			world.add_opaque_object(pyramid)
29
30			create exit.with_label(win, U"Click: Exit  |  Move: Turn")
31			exit.when_pointer_move(agent turn)
32			exit.when_left_clicked(agent finish_program)
33
34			win.when_close_requested(agent finish_program)
35
36			vision.start
37		end
38
39	turn is
40		do
41			rot := rot + 2
42			pyramid.turn(rot, -3*rot)
43			world.display_gl
44		end
45
46	finish_program is
47		do
48			vision.loop_stack.break
49		end
50end