/tutorial/vision/opengl/NeHe/lesson04/triangle.e
http://github.com/tybor/Liberty · Specman e · 41 lines · 33 code · 7 blank · 1 comment · 0 complexity · a77f3912fd0b5c4433f5e8706c9040a0 MD5 · raw file
- class TRIANGLE
- inherit
- GL_OBJECT
- redefine draw
- end
- creation
- make_with_position
- feature{ANY}
- build is
- do
- end
- draw is
- do
- gl.disable(gl.const_cull_face)
- smart_gl.rotate(angle, 0, 1, 0)
- smart_gl.begin_triangles
- full_red.render
- smart_gl.vertex(0, 1, 0)
- full_green.render
- smart_gl.vertex(-1, -1, 0)
- full_blue.render
- smart_gl.vertex(1, -1, 0)
- smart_gl.end_primitive
- end
-
- anim (widget: GL_WIDGET): BOOLEAN is
- do
- angle := angle + 2
- widget.display_gl
- --post_redisplay
- Result := True
- end
- feature{}
- angle: REAL
- end