/tutorial/vision/opengl/NeHe/lesson02/lesson02.e

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

  1. class LESSON02
  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 02")
  17. win.set_background_color(white_color)
  18. win.map
  19. create world.make(win)
  20. -- The positions are directly given in the 3D coordinate system.
  21. -- As both object are independant, their respective translation are private and don't compose.
  22. create triangle.make_with_position(-1.5, 0.0, -6.0)
  23. world.add_opaque_object(triangle)
  24. create square.make_with_position(1.5, 0, -6)
  25. world.add_opaque_object(square)
  26. create exit.with_label(win, U"Exit")
  27. exit.when_left_clicked(agent finish_program)
  28. win.when_close_requested(agent finish_program)
  29. vision.start
  30. end
  31. finish_program is
  32. do
  33. vision.loop_stack.break
  34. --***world.quit_gl
  35. end
  36. end