diff --git a/basis/opengl/opengl-tests.factor b/basis/opengl/opengl-tests.factor new file mode 100644 index 0000000000..818d0db8b7 --- /dev/null +++ b/basis/opengl/opengl-tests.factor @@ -0,0 +1,6 @@ +USING: tools.test math opengl opengl.gl ; +IN: opengl.tests + +{ 2 1 } [ { GL_TEXTURE_2D } [ + ] all-enabled ] must-infer-as + +{ 2 1 } [ { GL_TEXTURE_2D } [ + ] all-enabled-client-state ] must-infer-as diff --git a/basis/opengl/opengl.factor b/basis/opengl/opengl.factor index 513ed912e4..1f6205e64f 100755 --- a/basis/opengl/opengl.factor +++ b/basis/opengl/opengl.factor @@ -56,7 +56,9 @@ TUPLE: gl-error function code string ; [ ?execute ] map ; : (all-enabled) ( seq quot -- ) - over [ glEnable ] each dip [ glDisable ] each ; inline + [ dup [ glEnable ] each ] dip + dip + [ glDisable ] each ; inline : (all-enabled-client-state) ( seq quot -- ) [ dup [ glEnableClientState ] each ] dip