1 USING: arrays kernel math opengl opengl.gl opengl.glu
2 opengl.demo-support ui ui.gadgets ui.render ui.pixel-formats
6 TUPLE: nehe2-gadget < gadget ;
11 : <nehe2-gadget> ( -- gadget )
14 M: nehe2-gadget draw-gadget* ( gadget -- )
16 GL_PROJECTION glMatrixMode
18 45.0 width height / >float 0.1 100.0 gluPerspective
19 GL_MODELVIEW glMatrixMode
21 GL_SMOOTH glShadeModel
22 0.0 0.0 0.0 0.0 glClearColor
24 GL_DEPTH_TEST glEnable
26 GL_PERSPECTIVE_CORRECTION_HINT GL_NICEST glHint
27 GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT bitor glClear
29 -1.5 0.0 -6.0 glTranslatef
31 0.0 1.0 0.0 glVertex3f
32 -1.0 -1.0 0.0 glVertex3f
33 1.0 -1.0 0.0 glVertex3f
35 3.0 0.0 0.0 glTranslatef
37 -1.0 1.0 0.0 glVertex3f
38 1.0 1.0 0.0 glVertex3f
39 1.0 -1.0 0.0 glVertex3f
40 -1.0 -1.0 0.0 glVertex3f
45 { title "NeHe Tutorial 2" }
46 { pref-dim { $ width $ height } }
47 { pixel-format-attributes {
50 T{ depth-bits { value 16 } }
53 <nehe2-gadget> >>gadgets ;