1 USING: arrays kernel math opengl opengl.gl opengl.glu
2 opengl.demo-support ui ui.gadgets ui.render ;
5 TUPLE: nehe3-gadget < gadget ;
10 : <nehe3-gadget> ( -- gadget )
11 nehe3-gadget new-gadget ;
13 M: nehe3-gadget pref-dim* ( gadget -- dim )
14 drop width height 2array ;
16 M: nehe3-gadget draw-gadget* ( gadget -- )
18 GL_PROJECTION glMatrixMode
20 45.0 width height / >float 0.1 100.0 gluPerspective
21 GL_MODELVIEW glMatrixMode
23 GL_SMOOTH glShadeModel
24 0.0 0.0 0.0 0.0 glClearColor
26 GL_DEPTH_TEST glEnable
28 GL_PERSPECTIVE_CORRECTION_HINT GL_NICEST glHint
29 GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT bitor glClear
31 -1.5 0.0 -6.0 glTranslatef
34 0.0 1.0 0.0 glVertex3f
36 -1.0 -1.0 0.0 glVertex3f
38 1.0 -1.0 0.0 glVertex3f
40 3.0 0.0 0.0 glTranslatef
43 -1.0 1.0 0.0 glVertex3f
44 1.0 1.0 0.0 glVertex3f
45 1.0 -1.0 0.0 glVertex3f
46 -1.0 -1.0 0.0 glVertex3f
50 <nehe3-gadget> "NeHe Tutorial 3" open-window ;