 
 VAR: background
 
-: initial-background ( -- hsba ) 0 0 1 1 <hsba> new ;
+: set-initial-background ( -- ) { 0 0 1 1 } clone >color ;
 
 : set-background ( -- )
-  initial-background >color
+  set-initial-background
   background> call
   color> gl-clear-hsba ;
 

  init-modelview-matrix-stack
  init-color-stack

  initial-color >color

  color> gl-set-hsba

  start-shape> call ;

: cfdg-window* ( -- )
[ display ] closed-quot <slate>
  { 500 500 } over set-slate-dim
  dup "CFDG" open-window ;



: init-color-stack ( -- ) V{ } clone >color-stack ;

: push-color ( -- ) color> color-stack> push   color> clone >color ;

: pop-color ( -- ) color-stack> pop dup >color gl-set-hsba ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

: double-nth* ( c-array indices -- seq ) swap [ double-nth ] curry map ;

: check-size ( modelview -- num ) { 0 1 4 5 } double-nth* [ abs ] map biggest ;

VAR: threshold

: iterate? ( -- ? ) get-modelview-matrix check-size threshold> > ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

