-USING: arrays kernel math opengl opengl.gl opengl.glu ui
-ui.gadgets ui.render ;
+USING: accessors kernel literals math opengl.demo-support
+opengl.gl opengl.glu ui ui.gadgets ui.render ;
IN: nehe.3
TUPLE: nehe3-gadget < gadget ;
-: width 256 ;
-: height 256 ;
+CONSTANT: width 256
+CONSTANT: height 256
: <nehe3-gadget> ( -- gadget )
- nehe3-gadget new-gadget ;
-
-M: nehe3-gadget pref-dim* ( gadget -- dim )
- drop width height 2array ;
+ nehe3-gadget new ;
M: nehe3-gadget draw-gadget* ( gadget -- )
drop
-1.0 -1.0 0.0 glVertex3f
] do-state ;
-: run3 ( -- )
- <nehe3-gadget> "NeHe Tutorial 3" open-window ;
+MAIN-WINDOW: run3 { { title "NeHe Tutorial 3" } { pref-dim { $ width $ height } } }
+ <nehe3-gadget> >>gadgets ;