]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/splines/viewer/viewer.factor
factor: trim using lists
[factor.git] / extra / math / splines / viewer / viewer.factor
index 59c347d740f17f6e41da46bdb1e0b7c5369da628..ad0269c01a8434a32787ad24f9ce99cd0b2edf81 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2010 Erik Charlebois.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel locals math math.order math.polynomials
-math.splines opengl.gl sequences ui.gadgets ui.gadgets.panes ui.render
-arrays ;
+USING: accessors kernel math math.order math.polynomials
+opengl.demo-support opengl.gl sequences ui.gadgets
+ui.gadgets.panes ui.render arrays ;
 IN: math.splines.viewer
 
 <PRIVATE
@@ -33,11 +33,11 @@ M:: spline-gadget draw-gadget* ( gadget -- )
         [ second y-min - y-max y-min - / gadget spline-dim>> second * ] bi 2array
     ] map :> pts
 
-    GL_LINE_STRIP glBegin
-    pts [
-        first2 neg gadget spline-dim>> second + glVertex2f
-    ] each
-    glEnd ;
+    GL_LINE_STRIP [
+        pts [
+            first2 neg gadget spline-dim>> second + glVertex2f
+        ] each ]
+    do-state ;
 
 :: <spline-gadget> ( polynomials dim steps -- gadget )
     spline-gadget new