/tutorial/vision/opengl/NeHe/lesson03/lesson03.e

http://github.com/tybor/Liberty · Specman e · 42 lines · 33 code · 9 blank · 0 comment · 0 complexity · bcae137803e752f033c9f9103f741665 MD5 · raw file

  1. class LESSON03
  2. inherit
  3. GRAPHIC
  4. creation
  5. make
  6. feature{ANY}
  7. world : WORLD
  8. triangle : TRIANGLE
  9. square : SQUARE
  10. make is
  11. local
  12. win: TOPLEVEL_WINDOW
  13. exit : BUTTON
  14. do
  15. create win.default_create
  16. win.set_title("Lesson 03")
  17. win.set_background_color(white_color)
  18. win.map
  19. create world.make(win)
  20. create triangle.make_with_position(-1.5, 0.0, -6.0)
  21. world.add_opaque_object(triangle)
  22. create square.make_with_position(1.5, 0, -6)
  23. world.add_opaque_object(square)
  24. create exit.with_label(win, U"Exit")
  25. exit.when_left_clicked(agent finish_program)
  26. win.when_close_requested(agent finish_program)
  27. vision.start
  28. end
  29. finish_program is
  30. do
  31. vision.loop_stack.break
  32. end
  33. end