 TUPLE: spheres-gadget < demo-gadget
     plane-program solid-sphere-program texture-sphere-program
     reflection-framebuffer reflection-depthbuffer
-    reflection-texture ;
+    reflection-texture initialized? ;
 
 : <spheres-gadget> ( -- gadget )
     20.0 10.0 20.0 spheres-gadget new-demo-gadget ;

    ] bi ;

: reflection-frustum ( gadget -- -x x -y y near far )
    [ near-plane ] [ far-plane ] bi [
        drop dup [ -+ ] bi@
    ] 2keep ;

: (reflection-face) ( gadget face -- )
    swap reflection-texture>> >r >r

        [ dim>> 0 0 rot first2 glViewport ]
    } cleave ] with-framebuffer ;

: (draw-gadget) ( gadget -- )
    GL_DEPTH_TEST glEnable
    GL_SCISSOR_TEST glDisable
    0.15 0.15 1.0 1.0 glClearColor {
