/tutorial/vision/opengl/NeHe/lesson02/lesson02.e
Specman e | 45 lines | 33 code | 9 blank | 3 comment | 0 complexity | f7bd4d58308e9cd1486faf34786666b4 MD5 | raw file
1class LESSON02 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 do 20 create win.default_create 21 win.set_title("Lesson 02") 22 win.set_background_color(white_color) 23 win.map 24 25 create world.make(win) 26 -- The positions are directly given in the 3D coordinate system. 27 -- As both object are independant, their respective translation are private and don't compose. 28 create triangle.make_with_position(-1.5, 0.0, -6.0) 29 world.add_opaque_object(triangle) 30 create square.make_with_position(1.5, 0, -6) 31 world.add_opaque_object(square) 32 33 create exit.with_label(win, U"Exit") 34 exit.when_left_clicked(agent finish_program) 35 win.when_close_requested(agent finish_program) 36 37 vision.start 38 end 39 40 finish_program is 41 do 42 vision.loop_stack.break 43 --***world.quit_gl 44 end 45end