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

http://github.com/tybor/Liberty · Specman e · 27 lines · 21 code · 5 blank · 1 comment · 0 complexity · db704c1dc914d2f5e61f18b28db0c09b MD5 · raw file

  1. class SQUARE
  2. inherit
  3. GL_OBJECT
  4. redefine draw
  5. end
  6. creation
  7. make_with_position
  8. feature{ANY}
  9. build is
  10. do
  11. end
  12. draw is
  13. do
  14. -- Vertices must be given in counter-clockwise order
  15. smart_gl.begin_quads
  16. smart_gl.vertex(-1, 1, 0)
  17. smart_gl.vertex(-1, -1, 0)
  18. smart_gl.vertex(1, -1, 0)
  19. smart_gl.vertex(1, 1, 0)
  20. smart_gl.end_primitive
  21. end
  22. end