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

http://github.com/tybor/Liberty · Specman e · 29 lines · 23 code · 5 blank · 1 comment · 0 complexity · bfb69872d54706b736c15ccbcb7d4ffa 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. -- In SMART_GL, all colors are given with 4 values (including alpha value)
  15. smart_gl.begin_triangles
  16. full_red.render
  17. smart_gl.vertex(0, 1, 0)
  18. full_green.render
  19. smart_gl.vertex(-1, -1, 0)
  20. full_blue.render
  21. smart_gl.vertex(1, -1, 0)
  22. smart_gl.end_primitive
  23. end
  24. end