/tutorial/vision/opengl/NeHe/lesson03/square.e
Specman e | 31 lines | 25 code | 5 blank | 1 comment | 0 complexity | 43df687619ce3f79f3764dae2446b77e MD5 | raw file
1class SQUARE 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 local 18 color: GL_COLOR 19 do 20 -- In SMART_GL, all colors are given with 4 values (including alpha value) 21 create color.set_color(0.5, 0.5, 1, 1) 22 smart_gl.begin_quads 23 color.render 24 smart_gl.vertex(-1, 1, 0) 25 smart_gl.vertex(-1, -1, 0) 26 smart_gl.vertex(1, -1, 0) 27 smart_gl.vertex(1, 1, 0) 28 smart_gl.end_primitive 29 end 30 31end