/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

  1. class LESSON05
  2. inherit
  3. GRAPHIC
  4. creation
  5. make
  6. feature{ANY}
  7. world : WORLD
  8. pyramid : PYRAMID
  9. cube : CUBE
  10. make is
  11. local
  12. win: TOPLEVEL_WINDOW
  13. exit : BUTTON
  14. anim : SIMPLE_PERIODIC_JOB
  15. do
  16. create win.default_create
  17. win.set_title("Lesson 05")
  18. win.set_background_color(white_color)
  19. win.map
  20. create world.make(win)
  21. create pyramid.make_with_position(-1.5, 0.0, -6.0)
  22. world.add_opaque_object(pyramid)
  23. create cube.make_with_position(1.5, 0, -6)
  24. world.add_opaque_object(cube)
  25. create exit.with_label(win, U"Exit")
  26. exit.when_left_clicked(agent finish_program)
  27. win.when_close_requested(agent finish_program)
  28. create anim.set_work(agent pyramid.anim(world), Void, 1, 0.01)
  29. vision.loop_stack.add_job(anim)
  30. create anim.set_work(agent cube.anim(world), Void, 1, 0.01)
  31. vision.loop_stack.add_job(anim)
  32. vision.start
  33. end
  34. finish_program is
  35. do
  36. vision.loop_stack.break
  37. end
  38. end