PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1class TRIANGLE
 2
 3inherit
 4	GL_OBJECT
 5		redefine draw
 6		end
 7
 8creation
 9	make_with_position
10
11feature{ANY}
12	build is
13		do
14		end
15
16	draw is
17		do
18			gl.disable(gl.const_cull_face)
19			smart_gl.rotate(angle, 0, 1, 0)
20			smart_gl.begin_triangles
21			full_red.render
22			smart_gl.vertex(0, 1, 0)
23			full_green.render
24			smart_gl.vertex(-1, -1, 0)
25			full_blue.render
26			smart_gl.vertex(1, -1, 0)
27			smart_gl.end_primitive
28		end
29		
30	anim (widget: GL_WIDGET): BOOLEAN is
31		do
32			angle := angle + 2
33			widget.display_gl
34			--post_redisplay
35			Result := True
36		end
37
38feature{}
39	angle: REAL
40
41end