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

/tutorial/vision/opengl/example5.e

http://github.com/tybor/Liberty
Specman e | 61 lines | 44 code | 17 blank | 0 comment | 0 complexity | c4ebaf600eef4bebee15c25dac1ec148 MD5 | raw file
 1class EXAMPLE5
 2
 3inherit
 4	GRAPHIC
 5
 6creation
 7	make
 8
 9feature{ANY}
10
11	world: INTERACTIVE_WORLD
12
13	win: TOPLEVEL_WINDOW
14
15	angle: REAL
16	
17	make is
18		local
19			universal_world_loader: UNIVERSAL_WORLD_LOADER[LOADABLE_GL_OBJECT]
20			universal_object_loader: UNIVERSAL_OBJECT_LOADER[LOADABLE_GL_OBJECT]
21			universal_texture_loader: UNIVERSAL_TEXTURE_LOADER
22
23			xml_world_loader: XML_WORLD_LOADER[LOADABLE_GL_OBJECT]
24			xml_object_loader: XML_OBJECT_LOADER[LOADABLE_GL_OBJECT]
25			bmp_texture_loader: BMP_TEXTURE_LOADER
26		do
27		
28			create win.default_create
29			win.set_title("Example 5")
30			win.set_background_color(white_color)
31			win.map
32
33			create universal_world_loader.make
34			create universal_object_loader.make
35			create universal_texture_loader.make
36			
37			universal_world_loader.add_lookup_directory("data/world")
38			universal_object_loader.add_lookup_directory("data/object")
39			universal_texture_loader.add_lookup_directory("data/texture")
40
41			create xml_world_loader.make
42			create xml_object_loader.make
43			create bmp_texture_loader.make
44			
45			universal_world_loader.add_loader("xml", xml_world_loader)
46			universal_object_loader.add_loader("xml", xml_object_loader)
47			universal_texture_loader.add_loader("bmp", bmp_texture_loader)
48
49			create world.make_interactive(win, agent finish_program)
50			universal_world_loader.load_world(world, "world.xml", universal_object_loader, universal_texture_loader)
51
52			win.when_close_requested(agent finish_program)
53
54			vision.start
55		end
56
57	finish_program is
58		do
59			vision.loop_stack.break
60		end
61end