 
 : <gl-buffer> ( target data hint -- id )
     pick gen-gl-buffer [ [
-        >r dup byte-length swap r> glBufferData
+        [ dup byte-length swap ] dip glBufferData
     ] with-gl-buffer ] keep ;
 
 : buffer-offset ( int -- alien )

    [ glGenBuffers ] (gen-gl-object) ;

: (delete-gl-object) ( id quot -- )
    >r 1 swap <uint> r> call ; inline

: delete-texture ( id -- )
    [ glDeleteTextures ] (delete-gl-object) ;

    [ glDisableClientState ] each ; inline

MACRO: all-enabled ( seq quot -- )
    [ words>values ] dip [ (all-enabled) ] 2curry ;

MACRO: all-enabled-client-state ( seq quot -- )
    [ words>values ] dip [ (all-enabled-client-state) ] 2curry ;

: do-matrix ( mode quot -- )
    swap [ glMatrixMode glPushMatrix call ] keep
