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

http://github.com/tybor/Liberty · Specman e · 25 lines · 20 code · 5 blank · 0 comment · 0 complexity · 1e568fbe16b77abf0840e039055fe9ca MD5 · raw file

  1. class TRIANGLE
  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. smart_gl.begin_triangles
  15. smart_gl.vertex(0, 1, 0)
  16. smart_gl.vertex(-1, -1, 0)
  17. smart_gl.vertex(1, -1, 0)
  18. smart_gl.end_primitive
  19. end
  20. end