]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/nehe/3/3.factor
factor: trim using lists
[factor.git] / extra / nehe / 3 / 3.factor
index af9b37f73e7319661d1f2618cd661b6687110159..d6dbe4b438aa043cce72615f3f45bfb09c451e35 100644 (file)
@@ -1,18 +1,15 @@
-USING: arrays kernel math opengl opengl.gl opengl.glu
-opengl.demo-support 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 ;
 
-M: nehe3-gadget pref-dim* ( gadget -- dim )
-  drop width height 2array ;
-
 M: nehe3-gadget draw-gadget* ( gadget -- )
   drop
   GL_PROJECTION glMatrixMode
@@ -46,5 +43,5 @@ M: nehe3-gadget draw-gadget* ( gadget -- )
     -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 ;